J
Joe Cosby
I'm trying to write a script which converts a directory to html, so I
use
opendir()
readdir()
closedir()
to open a directory, read a list of file names, use the stat()
function on the file name to determine if it is a subdirectory, and
generate HTML links based on that.
I chdir to the directory I'm reading and this is succesful, and the
readdir() is pulling the correct list of file names, but when I try to
stat($filename) it fails.
There's no error message or anything, but when it executes
$st = stat($filename) or die "Can't stat file $filename\n";
it dies.
I am running Windows, I tried this on both a FAT32 directory and an
NTFS directory with the same result.
I tried CD'ing to the target directory before running the script, in
addiition to the chdir within the perl script, but no go.
Does anybody have any idea why this might be failing?
use
opendir()
readdir()
closedir()
to open a directory, read a list of file names, use the stat()
function on the file name to determine if it is a subdirectory, and
generate HTML links based on that.
I chdir to the directory I'm reading and this is succesful, and the
readdir() is pulling the correct list of file names, but when I try to
stat($filename) it fails.
There's no error message or anything, but when it executes
$st = stat($filename) or die "Can't stat file $filename\n";
it dies.
I am running Windows, I tried this on both a FAT32 directory and an
NTFS directory with the same result.
I tried CD'ing to the target directory before running the script, in
addiition to the chdir within the perl script, but no go.
Does anybody have any idea why this might be failing?