Open Binary File for Writing

Verb: openBinaryWriter

Available from: <Standard>

Opens a binary file for writing using the writing mode, the path, the share permission, and the encoding that can change the file later.

The command interprets all file types (.txt, .html, .pdf, ...) as binary.

Syntax

openBinaryWriter --mode(AutomationFileMode) --autoflush(Boolean) --share(AutomationFileShare) --path(String) --encoding(EncodingType) (BinaryFileWriter)=value

Inputs

Script Designer Required AcceptedTypes Description
--mode Mode Required AutomationFileMode Writing mode to open the binary file. Options:
  • Append
  • Create
  • Create New
  • Open
  • Open or Create
  • Truncate
  • --autoflush Auto Flush Required Boolean When enabled, makes it possible to automatically save each change within the binary file.
    --share Share Permission Required AutomationFileShare Option that allows you to perform actions within the binary file while it is open for writing:
  • Delete
  • Inheritable
  • None
  • Read
  • Read and Write
  • Write
  • --path Path Required Text Full path of the binary file used for writing.
    --encoding Encoding Required EncodingType Character encoding to be used for binary file writing. Options:
  • ASCII
  • Automatic
  • Big Endian Unicode
  • Operating System Default
  • Unicode
  • UTF32
  • UTF7
  • UTF8
  • Outputs

    Script Designer AcceptedTypes Description
    value Binary Writer Binary File Writer Open binary file for writing.

    Example

    The Open Binary File for Writing command opens the binary file and then the Write Text in Binary File command writes to the file.

    defVar --name binaryWriter --type BinaryFileWriter
    defVar --name filePath --type String
    defVar --name textValue --type String --value "IBM Robotic Process Automation"
    getSpecialFolder --folder "Desktop" filePath=value
    openBinaryWriter --mode "Create" --autoflush  --share "Write" --path "${filePath}\\binary.txt" --encoding "Default" binaryWriter=value
    binaryWriteString --value "${textValue}" --file ${binaryWriter}
    binaryFileClose --file ${binaryWriter}
    

    See Also

  • Binary Read Int
  • Close Binary File
  • Close Text File
  • Get Binary File Boolean
  • Get Binary File Characters
  • Get Binary File Text
  • Get Date and Time in Binary
  • Get Table from a Text File
  • Get Text File Line
  • Go to Text Reader Line
  • Move Index in Binary File
  • Open Binary File for Reading
  • Open Text File for Reading
  • Open Text File for Writing
  • Read Binary File Decimal
  • Read Binary File Time Span
  • Read Delimited Line of Text File
  • Read Text to the End
  • Save Changes to Binary File
  • Save Changes to Text File
  • Write Boolean in Binary File
  • Write Date Time in Binary File
  • Write Decimal to Binary File
  • Write Delimited Text Line to Text File
  • Write Delimited Texts in Text File
  • Write in Text File
  • Write Integer to Binary File
  • Write Text in Binary File
  • Write Text Line to Text File
  • Write Time Span in Binary File