NT vs Unix perl nits

Roxanne Reid-Bennett rox at tara-lu.com
Thu Apr 1 16:27:36 CST 1999


Arthur Corliss wrote:
>[...] 
> Does it?  I had thought that nlinks was the number of hard links to that
> particular file, not existing hard links within the directory.  

<shrug> I didn't even start this path, Jim found an example of how
to traverse directories in the O'Reilly Perl book (v4).  Playing with
stat, nlink gives back exactly how many directory entries are in the DIR
(including "." and "..") every time. So... given no other more
illuminating documentation on "stat" <g> 

> As for soft
> links, I believe that NTFS supports those as well, but not via the normal
> Explorer interface.  Shortcuts are just cheap shell tricks, if you ask me.
> Just a file with an address that the Explorer shell interprets.

Frankly I haven't played around with file systms under Unix or NT, so
which does what is... outside my knowledge base.

>[...] 
> I'm definitely interested in hearing more on this.  Out of curiosity, are you
> just looking for a faster method for gathering those statistics than using
> readdir and -d?

Jim was using it as a shortcut to finding out whether a subtraversal was
even necessary (e.g. recursively processing dirs).  He had to open the
dir later for processing the contents, so he moved the recursion to
there if the file was a -d type.

He was also suitably impressed with the ease with which perl dealt with
the string substitutions he was having to make.

Example outputs of "stat" looking at the same file

Unix:
    dev: 2081 inode: 802817 mode: 16877 nlink: 10 uid:501 mtime: 501
    ctime: 0 blksize: 1024 blocks:923005473   
NT:
    dev: 7 inode: 0 mode: 16895 nlink: 1 uid:0 mtime: 0 
    ctime: 7 blksize: 0 blocks:923005504

Rox
-- 
Roxanne Reid-Bennett                       rox at tara-lu.com
President, Tara-Lu Corporation     http://www.tara-lu.com/



More information about the Anchorage-pm mailing list