>From the ftruncate page: "If the file size is increased, the extended area shall appear as if it were zero-filled". It doesn't have to write zeros, just act like it did.
--David Garfield On Tue, Jan 24, 2012 at 08:19, Simon Slavin <slav...@bigfraud.org> wrote: > > On 24 Jan 2012, at 6:43am, David Henry wrote: > >> I am working without an operating system so there are no other agents trying >> to steal data. > > You're writing an operating system ? That can be lots of fun. Good luck. > >> Bearing that in mind, is it still necessary to actually write >> zero data to the sectors allocated? Is SQLite expecting it? > > I haven't looked though the code with that in mind, but as far as I know, > SQLite does not make any assumption about what will be in newly-assigned > sectors. If it wants zeros there it'll write them itself. > > It is ftruncate itself which chooses to write zeros to any newly-assigned > pages of disk space. This is part of the specification of ftruncate, and > documented here: > > <http://pubs.opengroup.org/onlinepubs/007908799/xsh/ftruncate.html> > > If your version of ftruncate doesn't write the zeros, you haven't implemented > ftruncate properly. But if you're not trying to reproduce UNIX, I guess it > doesn't matter. > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users