in reply to Re: Win32 Recursive Directory Listing
in thread Win32 Recursive Directory Listing

The system function returns the exit status code of the program, not its output. See system and the qx or backticks operator. More importantly, your code will only run on Win32, whereas File::Find will work on Unix and related systems as well.

Replies are listed 'Best First'.
Re: Re: Re: Win32 Recursive Directory Listing
by iakobski (Pilgrim) on Apr 10, 2002 at 12:36 UTC
    There is an issue with File::Find (and hand-rolled solutions too) on win32 when working with mapped file systems. It will stat every file to determine whether it is a directory and needs to be recursed into. Each stat requires a server round-trip which can be slow.

    If you call the DOS function you can do the whole thing in one hit. If you are certain the script will never be needed on a non-win32 system there is no issue with portability.

    I was doing something similar a while back, and reduced the run time from several hours to under ten minutes.

    -- iakobski