updf_revertΒΆ
updf_revert reverts all modifications since the last open or commit command (updf_commit).
-
bool = updf_revert(stg)
Return Value
If the function succeeds, the return value is TRUE (1); otherwise it is FALSE (0).
Parameters
-
stg
stg is a storage object (see updf_create_file, updf_open_file, updf_create_storage).
Example
def test_updf_revert()
{
ssPath = GetTempPath();
stg = updf_create_file(ssPath + "test.updf");
f = updf_create_stream(stg, "test");
fwrite_int8(f, 1:100);
updf_file_close(f);
updf_close_storage(stg);
stg = updf_open_file(ssPath + "test.updf");
f = updf_open_stream(stg, "test");
fwrite_int8(f, 120);
updf_file_close(f);
updf_revert(stg);
f = updf_open_stream(stg, "test");
i8 = fread_int8(f, 1);
if (i8 == 120) {
error();
}
updf_file_close(f);
updf_close_storage(stg);
}
test_updf_revert();
History
Version | Description |
---|---|
5.6.0 | New |
See also
id-1009928