How to erase/empty a file

what is the best way to erase/empty a file. I have a script which stores a variable in a text file. I will sometinmes ned to re-initilizs this file. I think that deleteing it and re creating the file may not be the best approach.

Is there a wile to empty the file? maybe moving the EOF to the begigin of the file?

Any ideas?

Thanks is advance for any assistance.

Bob

Something along these lines should work:

set file_ to open for access file "path:to:file:" with write permission
set eof of file_ to 0
close access file_

– Rob

Worked great