File: File.em

Description: File Access functions
Last Modified: 6/17/2006

File Constants:

AppendToFile( filename, morelines )
Parameters:
NameType
filenamestring
morelinesarray of strings
Explanation
Appends to a text file, adding newlines. Creates file if it does not exist.
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg
Return values
1 or error
Errors
"Invalid parameter type"
"Error in filename descriptor"
"No parent path traversal please."
"Access denied"
"Unable to open file: X"
"Error during write."
Related Configs
fileaccess.cfg



LogToFile( filename, line, flags := 0 )
Parameters:
NameType
filenameString
lineString
flagsInteger
Explanation
Appends a single line to a text file, adds newlines, creates file if it does not exist.
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg
file.em constants for flags:
const LOG_DATETIME := 1; // log Core-Style DateTimeStr in front of log entry
Return values
1 or error
Errors
"Invalid parameter type"
"Error in filename descriptor"
"No parent path traversal please."
"Access denied"
"Unable to open file: X"
"Error during write."
Related Configs
fileaccess.cfg



ReadFile( filename )
Parameters:
NameType
filenamestring
Explanation
Reads a text file, returning the contents as an array of strings, removing newlines.
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg
Return values
returns array of strings
Errors
"Invalid parameter type"
"Error in filename descriptor"
"No parent path traversal please."
"Access denied"
"File not found: X"
Related Configs
fileaccess.cfg



WriteFile( filename, textcontents )
Parameters:
NameType
filenamestring
textcontentsarray of strings
Explanation
Writes a new file to disk, appends newlines, creates file if it does not exist, renames existing file to filename.bak
By default, no package has any file access rights. To grant access, see config/fileaccess.cfg
Return values
1 or error
Errors
"Invalid parameter type"
"Error in filename descriptor"
"No parent path traversal please."
"Access denied"
"File not found: X"
"Error during write."
"Unable to remove filenameX: reasonY
"Unable to rename filenameX: to filenameZ: reasonY
Related Configs
fileaccess.cfg




If you know if any information is incorrect on these pages, mail your corrections to shinigami@gmx.net

Copyright ©2003-2011 David Carpman and Shinigami, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.