To allow an ESL application to manage the files and directories on the local machine the following subroutines are provided:
CreateDirectory( ) tells the system to build a directory at the specified path location. The routine only creates the final directory in the supplied path, so it is essential to ensure all the initial directories exist before this routine is used.
RemoveDirectory( ) deletes the specified directory; however, the directory must be empty for it to be deleted.
IsDirectory( ) determines whether the path location is a file or a directory, which is essential when building a path or emptying a directory, so that it can be deleted.
ListDirectory( ) create a newline delimited list of files and directories contained within a specified directory. This routine allows the ESL application to process the files and directories, for example, to empty a directory ready for removal.
DeleteFile( ) deletes a specified file, which is essential when temporary files are used during an ESL application session, to prevent large numbers of files building up on a system.
GetTempPath( ) obtains the path from the system where temporary files should be created. Ideally all temporary files used by the ESL application must be located in this directory, or a sub-directory of this location, so the system can identify them as temporary are suitable for deletion when performing a "Disk Clean-Up". Whilst temporary files should be deleted before the ESL application terminates, it is possible that the ESL fails before the a temporary file can be deleted.
GetTempFileName( ) identifies a unique file name within a specified directory, which is ideal when attempting to create a temporary file during the ESL application session. When a temporary file is created, the ESL application should attempt to delete the file before terminating.
GetFullPath( ) allows the ESL application to determine the absolute path of a file or directory. Many path within ESL are only relative to the current directory, which can change during the ESL application session, storing the full absolute path ensures the ESL application can always locate a file or directory. When the path input to this routine is a file, the file name is split from the path, which is useful when displaying to the operator when the full path is not significant.