StoreDiskFile (open)

Store a blob to disk

Syntax

LOADLIB "wh::files.whlib";

MACRO StoreDiskFile(STRING path, BLOB data, RECORD options)

Parameters

STRING path

Path to the file to create.

BLOB data

Blob to write

RECORD options

Options

BOOLEAN inplace

Create/overwrite the file in place. Normally, a temporary file is generated first

BOOLEAN overwrite

Overwrite if the file already exists? If TRUE, the function will overwrite the existing file. Defaultsto FALSE

BOOLEAN publicfile

If the file is created, should it be publicly readable? Defaults to TRUE

Description

Create a new file, or open an existing file, and writes the source data to the file. If the file already existed, its previous contents are erased. If overwrite is set, inplace is not set, and the filename length is shorter than 230 bytes, a temporary file will be created and moved over the original to ensure an atomic replace