dpdr
asked on
Scripts to list Directory file & contents
I'm looking for perl script to list the files in a directory and the contents of the files. The Contents could be driven from another file with single line discriptsion.
If you know of something like this please advise.
If you know of something like this please advise.
could use @file_stats = stat $file;
if you are talking about file att's such as size, mod date etc.
( $dev, $ino, $nlink, $uid, $gid, $rdev, $size,
$atime, $mtime, $ctime, $blksize, $blocks ) = stat $filename
t
if you are talking about file att's such as size, mod date etc.
( $dev, $ino, $nlink, $uid, $gid, $rdev, $size,
$atime, $mtime, $ctime, $blksize, $blocks ) = stat $filename
t
ASKER
I guess I should have been a little clearer. I'm tryint to creat a listing of documents in a directory. That have the document numbers and a comment line 25 chars. The output of the listing would be HTML and built on the fly. So once the directory was built files added to it would be pickup when someone would access it. then an edit script could be wriiten to add information to a file with the comment data in it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that looks like What I need.
I got it to do some stuff in ksh but perl should be faster.
From what you wrote I should be able to modify it if needed.
But starting in perl would mean learning it.
Thanks
I got it to do some stuff in ksh but perl should be faster.
From what you wrote I should be able to modify it if needed.
But starting in perl would mean learning it.
Thanks
while( defined($_=readdir(DIR)) ){
print "$_\n";
}
#I'm not sure I understand your second sentence.