different behaviour when accessing HD or USB storage

Discussion in 'Perl Misc' started by PilotMI80, Sep 13, 2004.

  1. PilotMI80

    PilotMI80 Guest

    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 ?
     
    PilotMI80, Sep 13, 2004
    #1
    1. Advertising

  2. PilotMI80

    Joe Smith Guest

    PilotMI80 wrote:

    > 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
     
    Joe Smith, Sep 15, 2004
    #2
    1. Advertising

  3. PilotMI80

    PilotMI80 Guest

    Joe Smith <> wrote in message news:<GeU1d.438135$%_6.292304@attbi_s01>...
    > PilotMI80 wrote:
    >
    > > 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


    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
     
    PilotMI80, Sep 16, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Altis

    Python on a USB storage device?

    Kevin Altis, Jul 28, 2003, in forum: Python
    Replies:
    6
    Views:
    418
    Chris Liechti
    Jul 29, 2003
  2. Samuel Schulenburg
    Replies:
    0
    Views:
    276
    Samuel Schulenburg
    Apr 28, 2004
  3. galapogos
    Replies:
    4
    Views:
    372
    Kenny McCormack
    May 11, 2007
  4. Replies:
    0
    Views:
    278
  5. LittleAlex
    Replies:
    0
    Views:
    439
    LittleAlex
    Sep 15, 2008
Loading...

Share This Page