Hi Christian,

>> - write 1 byte of data at this place
> 
> Shouldn't it be sufficient to seek to the desired size (as offset), then
> do a write with length zero there? (Writing with length zero extends or
> truncates the file to the current seek offset.)

Possibly, but I wanted to keep things simple and foolproof.

>> - close the file
>> - open file for writing (no truncate)
> 
> I would suggest not to close and re-open the file. If it does improve the
> operation's performance, then just committing the file should improve it
> in the same way. If performance isn't improved by it, the close and
> re-open sequence can be removed without replacement.

Same reason as above. Also, there is a small chance that some
implementations of commit are weaker than a full close / open.

So I went for the more explicit and possibly safer style here.

In any case, the performance penalty of close and re-open in
a situation where pre-growing fails to help is very neglible.

Eric


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to