File: File.em
Description: File Access functions
Last Modified: 6/18/2003
| AppendToFile( filename, morelines ) | |
|---|---|
| Parameters: | |
| Name | Type |
| filename | string |
| morelines | array 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, textline ) | |
|---|---|
| Parameters: | |
| Name | Type |
| filename | string |
| textline | string |
| 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 | |
| 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: | |
| Name | Type |
| filename | string |
| 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: | |
| Name | Type |
| filename | string |
| textcontents | array 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 racalac@polserver.com
Copyright ©2003-2011 David Carpman, all rights reserved. DO NOT REPRODUCE, MIRROR, ALTER, SPINDLE, MUTILATE, OR SIT ON.