This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question about inconsistent inode values for symbolic links to directories


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!

Cheers

Jools

Attachment: cygcheck.out
Description: Binary data

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]