updf_create_stream¶
updf_create_stream creates a new stream in a storage.
- file = updf_create_stream(stg, name, mode)
Return Value
file.
Parameters
- stg
stg is a storage object (see updf_create_file, updf_open_file, updf_create_storage).
- name
name.
- mode
mode.
Example
def test_updf_create_stream()
{
ssFile = GetTempPath() + "test.updf";
stg = updf_create_file(ssFile);
f = updf_create_stream(stg, "test");
s = "This is a test string. äöü\nLine 2\nLine 3";
fwrite_int8(f, strlen(s));
fwrite_char(f, s);
updf_file_close(f);
updf_close_storage(stg);
stg = updf_open_file(ssFile);
f = updf_open_stream(stg, "test");
i8 = fread_int8(f, 1);
if (i8 != strlen(s)) {
error();
}
s2 = fread_char(f, 1000);
s2 = utf8_decode(s2);
if (s != s2) error();
updf_file_close(f);
updf_close_storage(stg);
}
test_updf_create_stream();
History
Version |
Description |
---|---|
5.6.0 |
New |
See also
id-1556537