CreateDiskFileFromBlob (open)

Write a blob to disk

Syntax

LOADLIB "wh::files.whlib";

BOOLEAN FUNCTION CreateDiskFileFromBlob(STRING path, BOOLEAN failifexists, BOOLEAN publicfile, BLOB sourcedata)

Parameters

STRING path

Path to the file to create.

BOOLEAN failifexists

Fail if the file already exists? If TRUE the function will not overwrite the existing file. If FALSE the function will overwrite the existing file, if any.

BOOLEAN publicfile

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

BLOB sourcedata

Blob to write

Return value

BOOLEAN

True on success, false on I/O error

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.