Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

Comment on can't stat to e:/:
Download Code
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 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.
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.
    alyons@arzoo.com
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

    --=Lolindrath=--
Re: can't stat to e:/:
by tye (Cardinal) 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:/".

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://15396]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2014-09-02 22:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (32 votes), past polls