Write entire file

Command groupFlag affectedReversibleExecute on clientPlatform(s)
External commandsYESNONOWindows,Linux

Syntax

Write entire file
 
(path, binary-variable)
 
Returns 
err-code

Description

Note: The flag is set according to whether Omnis was able to make a call to this external command.

This command writes an entire file from a binary field, previously populated by using Read entire file. It returns an error code (See Error Codes), or zero if no error occurs. The Binary value is in the following format:

  1. 12 byte header containing the Type (4 bytes), Creator (4 bytes), and File length (4 bytes).
  2. File data.

Example

# read and then write the binary contents of mypicture.jpg

 
Calculate
 
lPathname
 as 
con
(
sys
(115),
'mypicture.png'
)

Read entire file
 
(
lPathname
,
lBinfld
)
 
Returns 
lErrCode

Write entire file
 
(
lPathname
,
lBinfld
)
 
Returns 
lErrCode