help-octave
[Top][All Lists]
Advanced

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

Re: How to truncate a file after partly overwriting it


From: Macy
Subject: Re: How to truncate a file after partly overwriting it
Date: Sat, 8 Feb 2014 09:53:04 -0800

clumsy, but might work for you.

take the first part you want and write it to file temp.txt
then open temp.txt as an append and write the new stuff
then overwrite your original file with the temp.txt file and erase temp.txt.


--- address@hidden wrote:

From: Philip Nienhuis <address@hidden>
To: address@hidden
Subject: How to truncate a file after partly overwriting it
Date: Sat, 8 Feb 2014 09:45:59 -0800 (PST)

Hi,

I'd like to partly overwrite a text file starting from position X. However,
the new part to be written is shorter than the rest of the original file
contents from X to EOF. Consequently, after the newly written part, the
remainder of the old contents show up.
So, how can I close & truncate the file after the end of the new part?

Thanks,

Philip




reply via email to

[Prev in Thread] Current Thread [Next in Thread]