Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Teams
, (opens new window)

Power Scripts for Jira Cloud
Results will update as you type.
  • Get started
  • Configuration guides
  • Integration guides
  • Feature guides
  • Advanced features
  • Migration resources
  • Simple Issue Language
    • Getting started with SIL
    • SIL reference guide
    • SIL Functions library
      • Function Index
      • Packages
      • Array Functions
      • Basic Functions
      • Date and Interval Functions
      • Excel Functions
      • File Manipulation Functions
        • createDirectory
        • createFile
        • deleteDirectory
        • deleteFile
        • directoryExists
        • fileClose
        • fileContains
        • fileCopy
        • fileExists
        • fileInfo
        • fileMove
        • fileOpen
        • fileRead
        • fileReadByte
        • fileReadLine
        • fileSeek
        • fileSHA256Checksum
        • fileSize
        • fileTruncate
        • fileWrite
        • findDirectories
        • findFiles
        • printInFile
        • readFromBinaryFile
        • readFromCSVFile
        • readFromTextFile
        • renameFile
        • writeToBinaryFile
        • zipFiles
      • HTTP Functions
      • Incoming Mail Processing Functions
      • Integration with Other Systems
      • Jira Administration Functions
      • Jira Integration Functions
      • Jira Service Management Functions
      • Jira Software Functions
      • Listener Functions
      • Math Functions
      • Parameter Functions
      • Scheduling Functions
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    File Manipulation Functions
    Updated Aug 11

    File Manipulation Functions



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

     

    Starting with SIL Engine 5.8.0.0 we limit the directories you have access to. By default you will have unrestricted access to the following directories:

    • sil.home (usually set on silprograms)

    • kepler.home (usually set on kepler)

    • <JIRA_HOME>/tmp

    • <JIRA_HOME>/log

    • <JIRA_HOME>/export

    • <JIRA_HOME>/import

    • <JIRA_HOME>/data

    • The directory announced by java.io.tmpdirvariable

    • The user home directory, if the user under which Jira runs has a home directory

    Extra directories may be specified defining sil.allowed.dirs property. The Java process must be launched with -Dsil.allowed.dirs=<path1>:<path2> ('nix systems) or -Dsil.allowed.dirs=<path1>;<path2> (Windows). Attempting to access files outside designated directories will result in error.

    Functions summary

    • createDirectory — Returns "true" if the directory was created successfully and "false" otherwise.
    • createFile — Creates an empty file.
    • deleteDirectory — Deletes a dir. It also returns "true" if the directory was deleted successfully and "false" otherwise.
    • deleteFile — Deletes a file. It also returns "true" if the file was deleted successfully and "false" otherwise.
    • directoryExists — Returns "true" if the directory exists and "false" otherwise.
    • fileClose — Closes a previously opened file and removes it from memory.
    • fileContains — Returns "true" if the file contains any string that matches the specified regex.
    • fileCopy — Copy a file from one location to another.
    • fileExists — Returns 'true' if the file exists and 'false' otherwise.
    • fileInfo — Returns basic file information about a file such as the date it was created.
    • fileMove — Moves a file from one location to another.
    • fileOpen — Opens a file in memory so that it may be read from.
    • fileRead — Reads a byte array from a file until it reaches the specified length or until the EOF is reached.
    • fileReadByte — Reads a byte from an open file.
    • fileReadLine — Reads a line of text from an open file until it reaches the end of the line (\n or \r\n). Stops also on EOF (end of file).
    • fileSeek — Moves the file pointer to a specific spot in an already open file. If the position is negative, moves the file pointer at the end of the file. If the position is 0 (zero) it moves the pointer at the beginning of the file.
    • fileSHA256Checksum — Returns the SHA256 checksum of the file.
    • fileSize — Returns the size for a given file.
    • fileTruncate — Clears the content of the specified file. Creates a new file if the one you want to clear content for doesn’t exist.
    • fileWrite — Writes text or byte data to an open file.
    • findDirectories — Searches for directories that match the given regex in the specified folder.
    • findFiles — Searches for files that match the given regex in the specified folder.
    • printInFile — Prints in the specified file the provided value.
    • readFromBinaryFile — Read the text of a binary file.
    • readFromCSVFile — Reads the values from the CSV file, returning them to an array, of N rows * M columns values.
    • readFromTextFile — Read the text of the file.
    • renameFile — Renames a file.
    • writeToBinaryFile — Prints bytes to a specified file. The file can be overwritten or appended to.
    • zipFiles — Adds a file or an array of files to a zip file.

     

    Peacock

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 16, "requestCorrelationId": "921fceee739543ecb739c0fb0bacf256"}