Open Binary File for Reading

Verb: openBinaryReader

Available from: <Standard>

Opens a binary file for reading using 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

openBinaryReader --share(AutomationFileShare) --path(String) --encoding(EncodingType) (BinaryFileReader)=value

Inputs

Script Designer Required AcceptedTypes Description
--share Share Mode Required AutomationFileShare Option that allows you to perform actions within the file while it is open for reading:
  • Delete
  • Inheritable
  • None
  • Read
  • Read and Write
  • Write
  • --path Path Required Text Full path of the binary file to be used for reading.
    --encoding Encoding Required EncodingType Character encoding used when reading binary file:
  • ASCII
  • Automatic
  • Big Endian Unicode
  • Operating System Default
  • Unicode
  • UTF32
  • UTF7
  • UTF8
  • Outputs

    Script Designer AcceptedTypes Description
    value Binary Reader Binary File Reader Binary file opened for reading.

    Example

    The Open Binary File for Reading command is used to open a binary file with read and write permissions and the Get Binary File Text command reads and returns the contents of the file.

    defVar --name binaryReader --type BinaryFileReader
    defVar --name textValue --type String
    // Open the file informed for reading.
    // Download the following file to run the command.
    openBinaryReader --share "Read" --path "binaryFile.txt" --encoding "Default" binaryReader=value
    // Get the text contained in the file.
    binaryReadString --file ${binaryReader} textValue=value
    // Close the binary file.
    binaryFileClose --file ${binaryReader}
    

    Download File


    For the correct operation of the script above, it is necessary to download the file and enter its path in the Path parameter of the Open Binary File for Reading command.

    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 Writing
  • 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