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.
  • 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
      • String Functions
      • System Integration
      • Webhooks Functions
  • Tutorials and recipes
  • Jira Product Discovery support
  • Release notes
  • Help and support
    You‘re viewing this with anonymous access, so some content might be blocked.
    /
    writeToBinaryFile
    Updated Aug 11

    writeToBinaryFile

    Syntax

    writeToBinaryFile(filepath, bytes [, append])

    Package

    file

    Alias

     

    Pkg Usage

    writeBinary(filepath, bytes [, append])

    Description

    Prints bytes to a specified file. The file can be overwritten or appended to.

    Parameters

    Parameter name

    Type

    Required

    Description

    Parameter name

    Type

    Required

    Description

    filepath

    String

    Yes

    Specifies the file name to write in.

    bytes

    Byte [] (Array of bytes)

    Yes

    Specifies the bytes to be written to the file.

    append

    Boolean

    No

    'true' if new bytes are added to the end of the file, otherwise 'false' (default) the whole file will be overwritten.

    Return Type

    Integer

    Return value represents the number of bytes written to the file.

    Example

    Example 1

    writeToBinaryFile("C:/myData.dat", dataBytes[], true)

    Writes (appends) the data from the dataBytes variable to the file "myData.dat".

    It is recommended that you use forward slashes ( / ) for file paths. As a general observation use the silEnv() function to create an absolute path.

    See also

    • Page:
      fileTruncate
    • Page:
      directoryExists
    • Page:
      deleteFile
    • Page:
      printInFile
    • Page:
      findDirectories
    • Page:
      fileSize
    • Page:
      createDirectory
    • Page:
      fileExists
    • Page:
      fileWrite
    • Page:
      fileSHA256Checksum
    • Page:
      readFromCSVFile
    • Page:
      createFile
    • Page:
      readFromTextFile
    • Page:
      zipFiles
    • Page:
      fileInfo
    • Page:
      fileCopy
    • Page:
      fileMove
    • Page:
      writeToBinaryFile
    • Page:
      fileOpen
    • Page:
      fileContains
    • Page:
      File Manipulation Functions
    • Page:
      readFromBinaryFile
    • Page:
      fileClose
    • Page:
      fileSeek
    • Page:
      fileReadByte
    Peacock

    Need support? Create a request with our support team.

    Copyright © 2005 - 2025 Appfire | All rights reserved.

    {"serverDuration": 15, "requestCorrelationId": "f90644665bfa438bb6e6786d56a20af6"}