httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Re: cvs commit: apache-apr/apr/test testfile.c
Date Mon, 07 Jun 1999 13:41:31 GMT
On Mon, 7 Jun 1999 07:54:36 -0400 (EDT), Ryan Bloom wrote:

>On 6 Jun 1999 bjh@hyperreal.org wrote:
>
>>   - The directory entry for a file doesn't have it's size attribute updated until
>>     the file is closed or flushed.
>
>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.



>Do you have any strong objections to putting the test back the way it was,
>and flushing the file with each write.  I know it will cause a performance
>hit, but it will make the results more predicatable.

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
equivalent of an fstat on the open file's handle (DosQueryFileInfo). This
will always return the true size and I've used it in the implementation of
ap_getfileinfo().

--
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message