updf_create_file creates a new updf file.
Return Value
stg is a new storage object of an error object (see error_create).
Parameters
name is the name of a updf file.
mode is one of the following values:
| UPDF_FAIL_IF_EXIST | If the file already exists the file will be not overwritten, instead an error-object will be returned. |
| UPDF_REPACKING | If storages, streams or attribute are deleted the file will shrink in size. If this flag is not set the space will be used for new objects. |
| UPDF_ZLIB_COMPRESSION | Improved compression with lower performance. |
Example
def test_updf_create_file()
{
ssFile = GetTempPath() + "test.updf";
stg = updf_create_file(ssFile);
if (type(stg) != "xStg") {
error();
}
f = updf_create_stream(stg, " test 1");
if (type(f) != "xFile") {
error();
}
fprintf(f, "%s", "This is a text written in Stream 'test 1'.");
fclose(f);
f = updf_create_stream(stg, "test 2");
if (type(f) != "xFile") {
error();
}
fprintf(f, "%s", "This is a text written in Stream 'test 2'.");
fclose(f);
updf_close_storage(stg);
}
test_updf_create_file()
History
| Version | Description |
|---|---|
| 5.6.0 | New |
See also
id-1891360