Mail Archives: djgpp-workers/1999/07/20/10:18:18
Bonjour M. Eli Zaretskii
> > An lseek()/write() will not do it, sometimes you want to create
> > a "hole" in the file by lseek()ing pass the size not ftruncate()ed
> > i.e. readjust its size.
>
> I think on DOS lseek followed by write does produce a hole like that.
> On DOS, a write of zero bytes has the effect of adjusting the file's
> size to the current byte position.
I'm not sure I follow, so you are saying if I want to shrink a file,
I can do that by lseek()ing back and write() 0 byte ?
To do this on Un*x I got to use ftruncate();
--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!
- Raw text -