info.mailtraq.com > Management > Script Functions A-Z > CreateFile() CreateFile()Creates a new, empty text file for writing. The function returns a handle which identifies the file, and is valid until it is released with the CloseFile(), function. Only new files can be written to because the file pointer is maintained at the end of the file. The opened file cannot be accessed by other scripts until its handle has been released. If the specified file already exists it is emptied.
handle := CreateFile( path )
- path
- Identifies the file to be created by its filing system name. If no path is quoted Mailtraq creates the file in the folder \database
- handle
- This identifier is used in subsequent references to the file, and should be released using CloseFile(). The null value is returned if the file could not be created.
//Example usage
myfile:= CreateFile("d:\internet\resource\sig-john.txt");
Write(myfile, "\n-- \nJohn Smith");
CloseFile(myfile) |