awohld has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl my $dirtoread="/home/mysite/public_html/t/d/"; opendir(IDIR, $dirtoread) || die "Error Opening Directory"; print "Content-type: text/html\n\n"; foreach $file ( sort readdir(IDIR) ) { ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$bl +ksize,$blocks) = stat($file); print <<EOF; File: $file dev: $dev ino: $ino mode: $mode nlink: $nlink uid: $uid gid: $gid rdev: $rdev size: $size atime: $atime mtime: $mtime ctime: $ctime blksize: $blksize blocks: $blocks } closedir(DIR);
File: . dev: 771 ino: 5915501 mode: 16877 nlink: 2 uid: 32088 gid: 590 rdev: 0 size: 4096 atime: 1115011633 mtime: 1115011632 ctime: 1115011632 blksize: 4096 blocks: 8 File: .. dev: 771 ino: 1507821 mode: 16877 nlink: 5 uid: 32088 gid: 590 rdev: 0 size: 4096 atime: 1115009208 mtime: 1115009208 ctime: 1115009208 blksize: 4096 blocks: 8 File: files dev: ino: mode: nlink: uid: gid: rdev: size: atime: mtime: ctime: blksize: blocks: File: fileviewer.pl dev: 771 ino: 5915502 mode: 33261 nlink: 1 uid: 32088 gid: 590 rdev: 0 size: 616 atime: 1115011637 mtime: 1115011632 ctime: 1115011632 blksize: 4096 blocks: 8 File: index.html dev: ino: mode: nlink: uid: gid: rdev: size: atime: mtime: ctime: blksize: blocks:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why is Stat() Not Stating All Files?
by merlyn (Sage) on May 02, 2005 at 05:39 UTC | |
by awohld (Hermit) on May 02, 2005 at 06:06 UTC | |
by PodMaster (Abbot) on May 02, 2005 at 06:27 UTC | |
by awohld (Hermit) on May 02, 2005 at 21:45 UTC | |
by PodMaster (Abbot) on May 03, 2005 at 04:04 UTC | |
|
Re: Why is Stat() Not Stating All Files?
by Zaxo (Archbishop) on May 02, 2005 at 05:54 UTC | |
|
Re: Why is Stat() Not Stating All Files?
by Fletch (Bishop) on May 02, 2005 at 13:32 UTC | |
|
Re: Why is Stat() Not Stating All Files?
by polettix (Vicar) on May 02, 2005 at 14:28 UTC |