File Manipulation routines

Looking for the documentation on the newest versions of SIL Engine and the Simple Issue Language for Jira 8 for Server/Data Center? Click here !


This section contains routines that enable users to handle directories and files.

Routines summary

  • createDirectoryReturns "true" if the directory was created successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.
  • createFileCreates an empty file. It also returns "true" if the file was created successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.
  • deleteFileDeletes a file. It also returns "true" if the file was deleted successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.
  • directoryExistsReturns "true" if the directory exists and "false" otherwise.
  • fileContainsReturns "true" if the file contains any string that matches the specified regex. If the regex contains a backslash replace it with two backslashes otherwise you will get a syntax error.
  • fileCopyCopy a file from one location to another. Returns "true" if the file was copied successfully and "false" otherwise. If "false" is returned check the log for a detailed reason on why it failed.
  • fileExistsReturns 'true' if the file exists and 'false' otherwise.
  • fileInfoReturns basic file information about a file such as the date it was created.
  • fileMoveMoves a file from one location to another.
  • fileSHA256ChecksumReturns the SHA256 checksum of the file.
  • fileSizeReturns the size for a given file.
  • findDirectoriesSearches for directories that match the given regex in the specified folder. The routine only searches for directories, not files.
  • findFilesSearches for files that match the given regex in the specified folder. The routine only searches for files, not directories.
  • printInFilePrints in the specified file the provided value. It appends the value to the file. For best results, use absolute paths, since relative paths are resolved starting with the current working directory.
  • readFromCSVFileReads the values from the CSV file, returning them to an array, of N rows * M columns values.
  • readFromTextFileRead the text of the file.
  • renameFileRenames a file.
  • zipFilesAdds a file or an array of files to a zip file. If the zip file doesn't exist, it will be created, otherwise it will be appended with all files that exist.