Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!mit-eddie!uw-beaver!rice!rice!sun-spots-request From: jsulliva@killington.prime.com (Jeff Sullivan) Newsgroups: comp.sys.sun Subject: ls -i vs. stat() Keywords: Miscellaneous Message-ID: <1990Aug23.225411.10266@rice.edu> Date: 15 Aug 90 22:12:13 GMT Sender: sun-spots-request@rice.edu Organization: Sun-Spots Lines: 29 Approved: Sun-Spots@rice.edu Originator: spots@titan.rice.edu X-Sun-Spots-Digest: Volume 9, Issue 308, message 17 I have noticed that 'ls -i' is giving different i-numbers for linked files, while stat() says that they are the same. This was noticed on SunOS 4.0.3. The man page for 'ls' says: -i For each file, print the i-number in the first column of the report. The simple program I that called the stat() system call did this: stat(filename,&sbuf); printf("\ti-number = %-10d %s\n",sbuf.st_ino,filename); Running a simple test: $ stattest stat.c i-number = 2953 stat.c $ ln -s stat.c stat.link $ stattest stat.* i-number = 2953 stat.c i-number = 2953 stat.link $ ln -i stat.* 2953 stat.c 38379 stat.link Is this the correct output for the 'ls -i' command? I would expect all links to have the same i-number as the original. Any help appreciated, Jeff Sullivan | Computervision/Prime | jsulliva@cvbnet.prime.com CADDS R&D | Bedford, MA 01730 | sun!cvbnet!jsulliva