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 pathPath to the file to create.
BOOLEAN failifexistsFail 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 publicfileIf the file is created, should it be publicly readable?
BLOB sourcedataBlob to write
Return value
BOOLEANTrue 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.