Reading/Deleting Last Line Of File

Alex Tweedly alex at tweedly.net
Fri Feb 12 09:30:36 EST 2010


Jeff Massung wrote:
>
> I'm still new to Rev, but in other languages this is dead simple:
>
>
>   
...
>     // nuke everything else at the end of the file
>     trunctate(fp, new_len);
>
>   
...
> Done.
>
> Now, maybe this isn't as easy in Rev as it is in C and *many* other
> languages. But it should be [if it isn't].
>   
That is *exactly* the problem - Rev doesn't expose ftruncate() (or 
ftell() either), so what should be very simple becomes very difficult.
 
In C, or Python, or even shell it is simple, but Rev's incomplete 
interface to the file system causes the problem.

I opened  a RQCC report  (#1851) in 2004 to request the enhancement of 
providing a way to get the file position (i.e. ftell()). That report 
remains "Unconfirmed".

Given that response, I have not chosen to waste any time entering an 
enhancement request for truncate.

-- Alex.



More information about the use-livecode mailing list