httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <>
Subject Re: cvs commit: apache-apr/apr/test testfile.c
Date Mon, 07 Jun 1999 15:15:30 GMT
On Mon, 7 Jun 1999 10:28:40 -0400 (EDT), Ryan Bloom wrote:

>> >I don't like this.  I would rather have the file flushed each time data is
>> >written to it, than have to close the file to update the directory update.
>> >I saw this same problem on Windows, and I just decided to flush the
>> >buffer.  IMHO, the OS is broken if it is buffering output to a file, but
>> >not using that buffer at ALL time the file is referenced.
>> It's not the file, just the directory information. The data written to a file
>> is immediately available via other handles to the same file.
>I would still say this is broken.  If I have written data to a file, the
>entire Filesystem should know that I have done it.  This happens in
>Windows, and it is possible for a user to write data to a file, check on
>the file in NT's expoder, and not have the file updated.  This is because
>the programmer didn't flush the buffers, or close the file.  The
>programmer is assuming the OS will keep everything up to date.  With at
>least these two platforms, the OS is NOT keeping the filesystem in synch.

I wouldn't go so far as to call it broken. It updates the directory with the
final result rather than all the intermediate ones. Sure it's nice to be able
to watch a file grow as it's written but it's rarely of critical importance.

Users of these platforms are used to seeing this behaviour. EG when I
download a file in Netscape it shows up as a 0 length file until the download
finishes (or dies).

>> When is it so important for the directory entry to be up date before the file
>> is closed? If the actual size is really needed it can be queried using the
>See above

I don't think that keeping the file manager's display up to date with every
write operation warrants the penalty of flushing after every write. I'm not
sure about Windoze but in OS/2 the required flush commits all data physically
to the disk so you'd negate all benefit of the write cache. Not a viable
choice as I see it.

 |  Brian Havard                 |  "He is not the messiah!                   |
 |  |  He's a very naughty boy!" - Life of Brian |

View raw message