Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

can't stat to e:/:

by jrsmith (Pilgrim)
on May 30, 2000 at 18:25 UTC ( #15396=perlquestion: print w/replies, xml ) Need Help??
jrsmith has asked for the wisdom of the Perl Monks concerning the following question:

i have a script using File::Find to search for a file (obviously). my problem is when i pass a var, like this:
my $dir = "e:\/"; find(\&search_sub, $dir);
i get an error: Can't stat to e:/: No such file or directory. it wouldn't have anything to do with the fact that e:/ is a cd drive would it? i tried the same script using c:/ and it worked fine, and i have other scripts which access e:/ in the same way with no errors. also if i leave off the trailing slash i get the same error except it says permission denied, i've tried this as admin and gotten the same error (i'm on an NT system) and i am just lost... if anybody has any ideas i'd appreciate it

Replies are listed 'Best First'.
Re: can't stat to e:/:
by perlcgi (Hermit) on May 30, 2000 at 19:34 UTC
    You're nearly there. This will work with my cd on H:
    #!/usr/bin/perl use File::Find; my $dir = 'H:\\'; find(\&search_sub,$dir); sub search_sub { print if /^SETUP/i }
Re: can't stat to e:/:
by alyons (Initiate) on May 30, 2000 at 22:24 UTC
    have you tried using the UNC naming convention for the filesystem?
    like: \\H\ ? I'm not a windows user so that's my best guess.

    Adam Lyons
    Senior Systems Engineer
    Arzoo! Inc.
Re: can't stat to e:/:
by lolindrath (Scribe) on Aug 01, 2000 at 22:51 UTC
    I haven't tried it but do this:
    cd e:
    then stat /
    that might work

Re: can't stat to e:/:
by tye (Sage) on Aug 01, 2000 at 23:11 UTC

    As I recall, this was a bug fixed quite a while ago in Win32 Perl. So either upgrade your copy of Perl or use "e:/." instead of "e:/".

RE: can't stat to e:/:
by Anonymous Monk on May 30, 2000 at 21:37 UTC
    well, the real issue here is your operating system. I strongly suggest getting a real platform to work with. In any case, have you TRIED to stat e:/, and are you being stupid and trying to open it in a filehandler and not stating the reference. it is readonly medium so don't try to change any of it's inodes ;) (@list) = stat "e:/"; @list is 13 elements, it will have a/m/ctime values in it in epoch time; $time = time; $time = localtime($time); your function probably doesn't stat right.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://15396]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2018-06-24 09:56 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.