On Wed, 21 Apr 2004, Eric Auer wrote: > ... which reminds me that when I fail to close() in plain DOS, > stat() does not reflect current file size while it does in > DOSEMU redirection drives. The DESIRED behaviour is that only > after close() the stat() information (directory entry) should > be updated, so plain DOS is "right" here (!).
What is DESIRED here? I always thought that directory entries were "undefined" rather than "not updated" until you close or commit (sync). What you're seeing with DOSEMU is just Linux behaviour. Try opening two xterms, in one put cat > foo in the other one ls -l foo and you see the "foo" size being updated. In fact this is exploited quite often by running a "tail" program in parallel to monitor if any output was added (try running "tail -f foo" instead of ls -l). If I understand the way Linux works correctly, a write() updates the dentry (directory entry) in the dentry cache. The stat() will then get the dentry from that same cache. DOSEMU translates a DOS write into a Linux write and a DOS findfirst into a readdir/stat combo; readdir is even necessary without wildcards because DOS is case insensitive and *nix isn't (at least, unless you use a mounted msdos/vfat/ntfs partition). Bart ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Freedos-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-devel
