File_Createdir; File_Delete; File_Dir - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

FILE_CREATEDIR

FILE_DELETE

FILE_DIR

NetLinx Programming Language Reference Guide
Creates a specified directory path.
Syntax:
SLONG File_CreateDir (CHAR DirPath[ ])
This function will not create the number of subdirectories needed to complete
the directory path if they do not exist. The subdirectories must be created one
level at a time.
Note: The LONG command cannot pass negative numbers, so if you have
errors these will never be recognized. SLONG must be assigned or errors will
be typecast to positive numbers.
Parameters:
• DirPath - string containing the directory path to create.
Result:
• 0 = operation was successful
• -4 = invalid directory path
• -5 = disk I/O error
• -13 = directory name exists
Example:
File_CreateDir('\CDLIST\')
File_CreateDir('\CDLIST\TEMP\')
Creates both \CDLIST and \CDLIST\TEMP subdirectories.
This function deletes the specified files.
SLONG FILE_DELETE (CHAR FilePath[ ])
Parameters:
• FilePath: Path name of the file to delete.
Result:
• 0: Operation was successful
• -2: Invalid file path or name
• -5: Disk I/O error
// delete all files in the directory \CDLIST\TEMP\Result =
File_Delete('\CDLIST\TEMP\')
This function returns a list of files located at the specified path. The syntax:
SLONG FILE_DIR (CHAR DirPath[ ], CHAR Buffer[ ], LONG
Entry)
Parameters:
• DirPath: String containing the path to the requested directory.
• Buffer: Buffer to hold the directory list.
• Entry: Requested directory entry.
This function returns the number of remaining files in the directory, or:
• -4: Invalid directory path
• -5: Disk I/O error
• -6: Invalid parameter (i.e. Entry points beyond the end of the directory, or is 0)
• -10: Buffer too small
• -12: Directory not loaded
Note: The LONG command cannot pass negative numbers, so if you have errors
these will never be recognized. SLONG must be assigned or errors will be type-
cast to positive numbers.
Reserved Identifiers
121

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents