delorie.com/archives/browse.cgi | search |
On Wed, Dec 08, 1999 at 04:46:57PM +1100, Andrew Dalgleish wrote: >There is a bug in the current handling of a file's inode. >I first noticed this when a "mv" failed on a remote drive. > >This is most easily verified by doing an "ls -i". >The listed inodes are not unique, and are not always the same for a >given file even when you execute "ls -i foo && ls -i foo". > >Using nFileIndexHigh and nFileIndexLow for an inode number is taking a >leap of faith. > >Here is the relevant section from the VC6 help (my line wrapping): > > nFileIndexLow > Specifies the low-order word of a unique identifier associated with >the file. > This identifier and the volume serial number uniquely identify a file. > This number may change when the system is restarted or when the file >is opened. > After a process opens a file, the identifier is constant until the >file is closed. > An application can use this identifier and the volume serial number to >determine whether two handles refer to the same file. > >Note the phrase "the identifier is constant until the file is closed". >The current code in stat() opens and closes the file. Yes. I was aware of this problem with remote shares but I'd never bothered to look in to fixing this. I appreciate the effort that went into tracking this down but I think it makes more sense to just add your code to the one place in cygwin where it is calculating inodes than to every single file path operation. So, in the next snapshot, you should see that I've done essentially what you've done in path.cc in fhandler_base.cc around the place where it does the inode calculation. Btw, have you sent in an assignment to us? If not, please go to the sourceware.cygnus.com web page and follow the links for contributing. There is an assignment form that we'll need for you to be able to contribute software to the project. Apologies if you've already done this and I just forgot. Thanks again for tracking this down so well. -chris
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |