Prev: Tcl/Tk 8.5.8: How to check the existence of an image in memory?
Next: Need Help: TCL\TK - adding multiple buttons in frame
From: Rebecca on 26 Jul 2010 15:18 Hi, Long story short, the company I work for uses Rational ClearCase which allows our files to be mounted on NFS stores. I'm working on something unique to the company at the moment -- opening/comparing CSV file data. However, something is erroneous with the NFS mount and IT feels that it's not a problem. The trouble is, these stale NFS handles do not play well with TCL's ability to located/use these files. Doing something like if { [file exists <blah.csv>] } ... returns true, and so it continues. However, only the file handle in the directory (linux, by the way) exists, and the inode for the file does not exist anymore. Doing: glob -directory <dir> * returns a list of files, including the ones that 'do not exist'. Similar linux FS behaviour is the 'ls' command, which simply looks in the directory's inode to get the handles for other files -- not the actual files' information. The behaviour of something like 'ls -l' is what should happen. This additional option follows the handle to the inode, and then finds out the file doesn't exist at this point, by looking for the 'long' information (timestamps, permissions, etc.). At the moment I need to use 'rexec 'ls -l'' in my code, and it is not ideal considering TCL has built-in 'file exists' and 'glob'. Discuss?
From: Craig on 26 Jul 2010 16:05
http://wiki.tcl.tk/2527 On 7/26/2010 12:18 PM, Rebecca wrote: > Hi, > > Long story short, the company I work for uses Rational ClearCase which > allows our files to be mounted on NFS stores. I'm working on something > unique to the company at the moment -- opening/comparing CSV file > data. However, something is erroneous with the NFS mount and IT feels > that it's not a problem. The trouble is, these stale NFS handles do > not play well with TCL's ability to located/use these files. Doing > something like > > if { [file exists<blah.csv>] } ... > > returns true, and so it continues. However, only the file handle in > the directory (linux, by the way) exists, and the inode for the file > does not exist anymore. Doing: > > glob -directory<dir> * > > returns a list of files, including the ones that 'do not exist'. > Similar linux FS behaviour is the 'ls' command, which simply looks in > the directory's inode to get the handles for other files -- not the > actual files' information. The behaviour of something like 'ls -l' is > what should happen. This additional option follows the handle to the > inode, and then finds out the file doesn't exist at this point, by > looking for the 'long' information (timestamps, permissions, etc.). > > At the moment I need to use 'rexec 'ls -l'' in my code, and it is not > ideal considering TCL has built-in 'file exists' and 'glob'. > > Discuss? |