lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 5 December 2011 12:44, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> I've recently run into the problem of trying to truncate a file in
>> lua... which doesn't seem to be possible
>
> truncating to zero length is the same as opening for writing, except for dates.
>

The functionality required is to shorten a file:
To do so now; you have make a new file and copy the old one across up
to the point you want.
Truncating to 0 length is a different problem :)

I really can't believe ftruncate didn't make it into ANSI C :(