question about inconsistent inode values for symbolic links to directories

Larry Hall (Cygwin) reply-to-list-only-lh@cygwin.com
Sat May 13 22:16:00 GMT 2006


julian_homer@hotmail.com wrote:
> Hi,
> 
> I am getting some strange inode values for some symbolic links to
> directories from a C program I am writing to traverse directories.
> 
> My understanding of the inode values of symbolic links and C functions is a
> follows:
> 
> 1. executing C function "stat" on symbolic link should return the inode
> value for whatever the link points to.
> 
> 2. executing C function "lstat" on symbolic link should return the inode
> value of the actual symbolic link.
> 
> 3. executing C function "readlink" on a symbolic link and the executing a
> "stat" on the output of the readlink should produce and identical inode
> value to a executing a "stat" on the symbolic link.
> 
> 
> The issue I am encountering is that the inode values from a "stat" of the
> symbolic link don't match the inode values of a "stat" of the output from a
> "readlink" of the symbolic value.
> 
> I have been able to repeat this using cygwin on a different machine. I have
> also executed the code on a solaris 8 system but didn't encounter any
> problems.
> 
> Bellow is a listing that shows and example of the problem
> 
> "path" "readlink" "inode stat path" "inode lstat path" "inode stat readlink"
> 
> /link_test/test1/c/c /link_test/test1 180134 589824 180126
> /link_test/test1/c /tmp 156721 6815744 19870
> 
> I would be grateful if anyone can shed any light on this. Expect it is me
> being an idiot somewhere!

Try the latest snapshot.  See if that helps any.

<http://cygwin.com/snapshots/>


-- 
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list