different behaviour when accessing HD or USB storage

P

PilotMI80

Hi all,

When trying to access a USB key with :

foreach(<$path/*>)
(or any combination of quotes )

it seems nothing is found.
The same actually works if $path is on my hard disk.

So, by now, I replaced this construction with :

opendir(DH, "$SourceFolder") or die "msg";
my @FolderContents = readdir DH;
closedir DH;
foreach(@FolderContents)

and it works perfectly (on both file systems)

My question is : is there a kind of flush mechanism that I missed ? or
will I have to use the workaround ?
Anyone got this kind of behaviour ?
 
J

Joe Smith

PilotMI80 said:
When trying to access a USB key with :

foreach(<$path/*>)
(or any combination of quotes )

That is guaranteed to fail if $path contains spaces in the name,
like "e:/My Files". As you've seen, readdir() does not have
that problem.
-Joe
 
P

PilotMI80

Joe Smith said:
That is guaranteed to fail if $path contains spaces in the name,
like "e:/My Files". As you've seen, readdir() does not have
that problem.
-Joe

thanks for your try, i have to be a bit more precise so you can answer
well


By "any combination of quotes", I meant white spaces were not the pb
cause I actually use "$path"/* :

For my tests I copied part of the hierarchy so that replacing the
drive letter has no incidence on the structure.

if $path is c:/foo, it works ok but if $path is f:/foo, it doesn't.
I guess there's a pb with the buffering with the key.
(I use Perl 5.6)

I can keep on with opendir but the con is that I need a global handle
for each.

thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top