This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Clear new space in fseek extended patches
- To: dj at delorie dot com (DJ Delorie)
- Subject: Re: Clear new space in fseek extended patches
- From: fnf at ninemoons dot com
- Date: Wed, 30 Aug 2000 18:07:00 -0700 (MST)
- Cc: nickc at redhat dot com, binutils at sources dot redhat dot com, fnf at ninemoons dot com
- Reply-To: fnf at be dot com
> I object to the logic. The only time you should write out the zeros
> is if you *write* after an fseek.
Do you mean write anywhere in the file after doing an fseek or only
when you write after the file location corresponding to where the
fseek that extended the file started? I suspect you mean the latter
and that the zero padding should only be to the extent necessary to
fill any holes in a sparse file.
> Merely fseeking past EOF shouldn't modify the file.
This does seem to be the standard UNIX behavior.
> Also, has anyone tested the relevent operating systems to see if the
> os's seek() past EOF remembers where it *should* be, rather than
> truncating at EOF? If they all preserve the file position beyond
> EOF, the logic is a lot simpler.
If you can be a little more precise about what you mean I'll concoct
a testcase and try it out on BeOS.
Thanks for the input.
-Fred