Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Missing files &

by Thelonius (Priest)
on Feb 07, 2007 at 17:16 UTC ( [id://598821]=note: print w/replies, xml ) Need Help??

in reply to Missing files &

Looking at the source code, it appears that the Windows Platform SDK defines PATH_MAX as 260, and that is more than 260 bytes long is going to cause problems.

The chdir() in the Microsoft C run-time always does a GetCurrentDirectory() after a SetCurrentDirectory() and it will fail if the absolute path name is more than 260 bytes, even if no single directory name is that large.

There might also be a bug in Perl or the C run-time so that a path name that large overwrites a buffer causing the file names to appear very weird (this is just speculation).

You might be able to get File::Find to work using the "no_chdir" option-- see the File::Find documentation.

Replies are listed 'Best First'.
Re^2: Missing files &
by sbas013 (Initiate) on Feb 08, 2007 at 08:50 UTC
    Oh no - RTFM! I was a bit sceptical that I would get ANY replies thinking File::Find was just too boring for someone to show any interest. That's put me in my place.
    I will try the no_chdir option & see how I get on. If this doesn't work I will be forced to have a look at wsh / vb, what a shame!
    Thanks for the pointer, very much appreciated.
Re^2: Missing files &
by Corion (Patriarch) on Feb 08, 2007 at 09:11 UTC

    Note that you can circumvent the PATH_MAX limit by using UNC filenames, as discussed in the CreateFile documentation by Microsoft. Some short testing shows that not changing the directory seems to work:

    perl -MFile::Find -le "for $d (@ARGV) {print qq(Scanning $d);find({no_ +chdir=>1, wanted=>sub{print $File::Find::name}},$d)}" \\?\Q:\ Q:\

    Without the no_chdir option, scanning the first entry (\\?\Q:\) fails immediately.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://598821]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-05-27 05:51 GMT
Find Nodes?
    Voting Booth?

    No recent polls found