bBox_FileRead( path; type {; offset; filename} )

Parameters:
   path: text containing POSIX file path (e.g., "/var/log/system.log")
   type: desired result type
      "F" = raw (binary) file
      "O" = make best guess based on file signature, returned as FILE or image
      "s" = UTF-8 result to be returned as text
      "U" = UTF-16 result to be returned as text
   offset: index to start reading at (optional)
   filename: file name to use instead of source name (for binary results only)

Result:
   container reference in chosen format

Error:
   bBox_LastError ("posix")

Script Step:
   bBox File Read [ POSIX Path; Offset ]

––––––––––

First appeared in: 0.63

Examples in demo file: 

Compatibility:   Client, macOS, Server, Ubuntu, WebDirect, WPE

––––––––––

Reads the file from path, returning a result of the given type.

This function can be used to read in a file to a variable or field. For the text data types, you’ll need to know the character encoding used, but typically these are UTF-8. As a safety measure, any input will be truncated at 2 GB.

The file path is a literal value; do not escape characters or enclose in quotes.

The optional filename parameter can be used for things like normalizing file names imported into the system.

––––––––––

bBox Functions

bBox Wiki