You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ryan Bloom <rb...@raleigh.ibm.com> on 1999/06/07 13:54:36 UTC
Re: cvs commit: apache-apr/apr/test testfile.c
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.
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.
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.
Re: cvs commit: apache-apr/apr/test testfile.c
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
> > 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.
>
> I agree that the directory on disk doesn't need to be updated,
> but surely you agree that the directory information cached in
> memory by the filesystem ought to be?
That's the problem. Until you flush the buffer or close the file, the
memory cache isn't updated. I don't care if the data gets written to
disk, but if the platform is going to buffer information, than it needs to
use that buffered information all the time. Not just for reading from the
file.
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.
Re: cvs commit: apache-apr/apr/test testfile.c
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Brian Havard wrote:
>
> 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.
I agree that the directory on disk doesn't need to be updated,
but surely you agree that the directory information cached in
memory by the filesystem ought to be?
--
#ken P-)}
Ken Coar <http://Web.Golux.Com/coar/>
Apache Software Foundation <http://www.apache.org/>
"Apache Server for Dummies" <http://Web.Golux.Com/coar/ASFD/>
Re: cvs commit: apache-apr/apr/test testfile.c
Posted by Brian Havard <br...@kheldar.apana.org.au>.
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! |
| brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian |
------------------------------------------------------------------------------
Re: cvs commit: apache-apr/apr/test testfile.c
Posted by Ryan Bloom <rb...@raleigh.ibm.com>.
> >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.
> 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
Ryan
_______________________________________________________________________
Ryan Bloom rbb@raleigh.ibm.com
4205 S Miami Blvd
RTP, NC 27709 It's a beautiful sight to see good dancers
doing simple steps. It's a painful sight to
see beginners doing complicated patterns.
Re: cvs commit: apache-apr/apr/test testfile.c
Posted by Brian Havard <br...@kheldar.apana.org.au>.
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 |
------------------------------------------------------------------------------