FileOps.$readentirefile()

Function group Execute on client Platform(s)
FileOps NO All

This function is no longer supported and has been removed from the Functions tab in the Catalog.

Syntax

FileOps.$readentirefile(cPath,&xVariable)

Description

Reads the entire file identified by cPath into binary xVariable. Pathnames can be over 255 characters, which was the limit in Studio 8.0.1 or earlier.

When called on macOS, the data read into xVariable includes the macOS resource fork and file type information. On return, the value in xVariable has the following format:

  1. 12 byte header containing the Type (4 bytes), Creator (4 bytes), and Data fork size (4 bytes).

  2. Data fork information.

  3. Resource fork information.

The size of the data fork determines where the resource fork data is stored, as shown below. Under Windows and Linux, the Type defaults to ‘TEXT’ the Creator to ‘mdos’ and the resource fork is empty.

The function returns an error code, or zero if successful: see the FileOps function error codes.

Example

Do FileOps.$readentirefile('/omnis/myfile',lBinary) Returns lError

; reads the file into the binary variable