Sethonator Posted June 14, 2007 Share Posted June 14, 2007 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... Link to comment Share on other sites More sharing options...
Marc Posted June 14, 2007 Share Posted June 14, 2007 $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 Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now