Jump to content
Sign in to follow this  

Clear content of a file

Recommended Posts



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?


Share this post

Link to post
Share on other sites

$file = FileOpen ( "filename", 2 )

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


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.