Reserved Identifiers
124
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
FILE_REMOVEDIR
This function removes the specified directory path, but it will not remove files or
directories below it.
CAUTION
:
If a subdirectory or files exist in the directory that you are trying to
remove, the operation will fail and will return a -5 (disk IO error).
SLONG FILE_REMOVEDIR (CHAR DirPath[ ])
Parameters:
•
DirPath
: String containing the directory path to remove.
Result:
• 0: Operation was successful
• -4: Invalid directory path
• -5: Disk I/O error
If you have \CDLIST\TEMP, and there are no files in either directory, the follow-
ing code will fail to delete the \CDLIST directory.
FILE_REMOVEDIR('\CDLIST')
The following code will delete the \CDLIST directory.
FILE_REMOVEDIR('\CDLIST\TEMP')FILE_REMOVEDIR('\CDLIST')
FILE_RENAME
This function renames the specified file.
SLONG FILE_RENAME (CHAR FilePath[ ], CHAR NewFileName[ ])
Parameters:
•
FilePath
: Path name of the file to rename.
•
NewFileName
: New file name. This name must not contain a directory path.
Result:
• 0: Operation was successful
• -2: Invalid file name
• -5: Disk I/O error
• -8: File name exists
// renames \CDLIST\OLDFILE.TXT to
\CDLIST\NEWFILE.TXTResult = FILE_RENAME
('\CDLIST\OLDFILE.TXT', 'NEWFILE.TXT')
FILE_SEEK
This function sets the file pointer to the specified position.
SLONG FILE_SEEK (LONG hFile, LONG Pos)
Parameters:
•
hFile
: Handle to the file returned by
File_Open
.
•
Pos
: The byte position to set the file pointer (0 = beginning of file, -1 = end of
file).
Result:
• >=0: Operation was successful and the result is the current file pointer value
• -1: Invalid file handle
• -5: Disk I/O error
• -6: Invalid parameter; pos points beyond the end-of-file (position is set to the
end-of-file)
After
FILE_SEEK
is successfully called, subsequent read or write operations
begin at the byte number specified by
Pos
.
// Sets the file pointer to byte number 1000. Subsequent
// read or write operations will begin at byte number
1000.Result = FILE_SEEK (hFile, 1000)
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...