
Reserved Identifiers
120
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
FILE_CLOSE
This function closes a file opened with
FILE_OPEN
. This function should be
called when all reading or writing to the file is completed.
SLONG File_Close (LONG hFile)
Parameters:
•
hFile
: Handle to the file returned by
File_Open
.
Result:
• 0: Operation was successful
• -1: Invalid file handle
• -5: Disk I/O error
• -7: File already closed
There is a limit to the number of file handles available from the system. If files
are not closed, it may not be possible to open a file.
Result = File_Close(hFile)
FILE_COPY
This function copies the specified file.
SLONG File_Copy(CHAR SrcFilePath[ ], CHAR DstFilePath[ ])
Parameters:
•
SrcFilePath
: Path name of the file to copy (source).
•
DstFilePath
: Path name of the copied file (destination).
Result:
• 0: Operation was successful
• -2: Invalid file name
• -5: Disk I/O error
• -11: Disk full
If either path name fails to specify a directory, the current directory is assumed.
The current directory is either the top-level directory or the subdirectory speci-
fied in the last call to
File_SetDir
.
// copy OLDFILE.TXT in the current directory to
NEWFILE.TXT
Result = File_Copy('OLDFILE.TXT', 'NEWFILE.TXT')
CHAR Buffer[1024]
SLONG NumFiles = 1
LONG Entry = 1
WHILE (NumFiles > 0)
{
NumFiles = FILE_DIR ('AAA:', Buffer, Entry)
Entry = Entry + 1
// add code to display contents of Buffer
}
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...