--
SwifT - Key-ID CDBA2FDB
LUG: http://www.lugwv.be - http://www.keyserver.net
Yes. But to give you a bit more to work with, let's look at a concreteQuote:> the hard link count number shown in ls -l for a directory is always greater
> than 1. is it because both the ../ and dir/ refer to the same inode so that
> the count is 2? thanks.
1) In /home, there's a hard link to /home/ftp (path /home/ftp)
2) In /home/ftp, there's a hard link to /home/ftp (path /home/ftp/.)
3) In /home/ftp/bin, there's a hard link to /home/ftp (path
/home/ftp/bin/..)
4) In /home/ftp/etc, there's a hard link to /home/ftp (path
/home/ftp/etc/..)
5) In /home/ftp/incoming, there's a hard link to /home/ftp (path
/home/ftp/incoming/..)
6) In /home/ftp/lib, there's a hard link to /home/ftp (path
/home/ftp/lib/..)
7) In /home/ftp/pub, there's a hard link to /home/ftp (path
/home/ftp/pub/..)
8) In /home/ftp/usr, there's a hard link to /home/ftp (path
/home/ftp/usr/..)
~ $ ls -l /home
...
drwxrwxrwx 8 root wheel 1024 Aug 1 1994 ftp
...
~ $ ls -l /home/ftp
total 7
drwxrwxrwx 2 root wheel 1024 Apr 7 1998 bin
drwxrwxrwx 2 root wheel 1024 Aug 30 1993 etc
drwxrwxrwx 2 root wheel 1024 Dec 3 1993 incoming
drwxrwxrwx 2 root wheel 1024 Nov 16 1993 lib
drwxrwxrwx 2 root wheel 1024 Aug 30 1993 pub
drwxrwxrwx 3 root wheel 1024 Aug 30 1993 usr
-rwxrwxrwx 1 root root 312 Aug 1 1994 welcome.msg
Well, we counted right
--
Lew Pitcher
Master Codewright and JOAT-in-training
Registered Linux User #112576
1. Why can't one make a link to a file with link count of zero?
Ok, I wrote a syscall that (from userland) looks like:
int flink(int fd, const char *topath);
and it works, but not in the most interesting case of when the link count
of the file referenced by fd is zero. Internally, the part that actually
does the work (after all the error checking and housekeeping is done) looks
like:
error=VOP_LINK(tovp,fromvp,topn.pn_path,CRED());
Can anyone give me a hint why that doesn't even work (when the link count
is zero) with an fd that is on a UFS filesystem? I would expect it not to
work with a clone-opened device or a pipe (which live on the
pseudo-filesystems specfs and fifofs respectively), but there's no reason I
can think of why it shouldn't work on UFS (and maybe lofs and NFS), unless
someone copped out and put the test for linking to a file with zero link
count in the VFS code rather than in the individual filesystems that may
(or may not) be able to handle it.
Any hints? Any hope this might work in some future Solaris version?
--
ftp> get |fortune
377 I/O error: smart remark generator failed
Bogonics: the primary language inside the Beltway
4. Local net access to masqerading host.
5. how do I determine which file is linked to another (hard link)
6. Fcron 1.1.1 - a replacement for Vixie cron and anacron
10. A hard link or a symbolic link?
11. Hard link to sym link - how to make?
13. hard links and symbolic links