Re: delete bytes?
- Posted by "Greg Haberek" <ghaberek at gmail.com> Mar 20, 2006
- 563 views
> I have a text file open and I want to write a few words after the 25th by= te and delete the rest. What should I do? its only 25 bytes, why not do this?
include get.e include file.e integer fn sequence bytes -- open file for reading fn = open("mytext.txt", "r") -- buffer the data bytes = get_bytes(fn, 25) -- close file close(fn) -- open file for writing fn = open("mytext.txt", "w") -- output buffer puts(fn, bytes) -- output our data puts(fn,"Aha!\n") -- close the file close(fn)
~Greg