FileOpen(filename, mode);
filename
mode
• w – Opens an empty file for writing. If the given file exists, its contents are destroyed.
• a – Opens for writing at the end of the file (appending) without removing the EOF marker before writing new data to the file; creates the file first if it does not exist.
• r – Opens for reading. If the file does not exist or cannot be found, the call fails.
• b – Open in binary mode; translations involving carriage-return and line-feed characters are suppressed.Opens the specified file for reading or writing according to mode specified. See also IoErrText.
0 >0 Failure. This value can be sent to IoErrText which will return an error text for the failure.//Open myfile.txt for writing and store the returned value in $err$err = fileopen("D:\documents\myfile.txt", "w");//If the action was unsuccessful, pass the error value//to ioerrtext and store the error text returned by
//ioerrtext in $errtext.
//Send the error text to the log fileif(num($err)!=0)
{
$errtext=ioerrtext($err);
log(0,"Errortext "+$errtext);
}
OpenText StreamServe 5.6 | Updated: 2013-03-01 |