Jump to content
Sign in to follow this  
Sethonator

Clear content of a file

Recommended Posts

Sethonator

Hello,

I want to clear a logfile after a certain step of a script.

I don't want to delete the whole file, but I want to clear the content, that the txt-file is empty...

Is there any command like clear file or something like that?

Tanks...

Share this post


Link to post
Share on other sites
Marc

$file = FileOpen ( "filename", 2 )
FileClose($file)

Should to the job. Excerpt from the help file:

Mode (read or write) to open the file in.

Can be a combination of the following:

0 = Read mode

1 = Write mode (append to end of file)

2 = Write mode (erase previous contents)

Hope this helps

Marc


It's my job to comfort the disturbed and to disturb the comfortable.
My Projects: Profiler, MakeSFX, UserInfo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×