Forums > Javascript

File Access Problem

August 17, 2007 | 6:11 pm

Hello!

When I open a file in write mode, is there a way to tell it to overwrite the file completely without having to delete it with something like java? The problem I am having is that if I try to write over a file with a smaller amount of data, the old file data remains after it.


August 17, 2007 | 9:39 pm

Set the eof property to 0.

jb

Am 17.08.2007 um 19:11 schrieb Rick Burnett:

>
> Hello!
>
> When I open a file in write mode, is there a way to tell it to
> overwrite the file completely without having to delete it with
> something like java? The problem I am having is that if I try to
> write over a file with a smaller amount of data, the old file data
> remains after it.


August 18, 2007 | 3:47 pm

Thanks! Haha, I had figured it out by trial and error. What I thought was interesting is that I tried to use the current position property and set the eof to that after I had done all my writing to the file but that didn’t work. I do not understand why it wouldn’t.

rick


Viewing 3 posts - 1 through 3 (of 3 total)