Write entire file

Command group Flag affected Reversible Execute on client Platform(s)
External commands YES NO NO Windows,Linux

Syntax

Write entire file (pathbinary-variableReturns 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:

Example

; read and then write the binary contents of mypicture.jpg
; sys(115) returns the full path to the Omnis executable
Calculate lPathname as con(sys(115),'mypicture.png')
Read entire file (lPathname,lBinfld) Returns lErrCode
Write entire file (lPathname,lBinfld) Returns lErrCode