1. Question with routine...
- Posted by LEVIATHAN <leviathan at USWEST.NET> Jan 12, 2001
- 414 views
- Last edited Jan 13, 2001
Heya all! I almost have this delete thing working right, except for one thing - it doesn't clean up the bytes at the end of the file. How would I do this? (And like the routine, I need to keep the memory usage extremely low) TIA, --"LEVIATHAN" -- Code... include file.e object junk procedure delete_data(sequence path, integer offset, integer bytes) --delete data n at offset integer fn,gap,c,fpos,offsetcounter offsetcounter = offset-1 fn=open(path,"ub") junk = seek(fn,-1) fpos=where(fn) junk = seek(fn,offset) -- move end of file for x=where(fn)+bytes to fpos by 1 do offsetcounter = offsetcounter+1 junk = seek(fn,x) c=getc(fn) junk = seek(fn,offsetcounter) puts(fn,c) flush(fn) end for close(fn) end procedure -- end code...