mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
22 lines
536 B
Text
22 lines
536 B
Text
use cfgfile;
|
|
use file;
|
|
|
|
OpenBinaryFile(":cfgtests:appendtest.cfg", OPENMODE_OUT|OPENMODE_TRUNC); // clear content
|
|
var props:={
|
|
{"key1","val1"},
|
|
struct{name:="key2", value:=1}
|
|
};
|
|
|
|
print(AppendConfigFileElem(":cfgtests:appendtest", "elem", 1, props));
|
|
|
|
var c:=ReadConfigFile(":cfgtests:appendtest");
|
|
print(c);
|
|
var e:=c["1"];
|
|
print(e.key1);
|
|
print(e.key2);
|
|
|
|
//invalid file
|
|
print(AppendConfigFileElem(":cfgtests:appendtest/", "elem", 1, props));
|
|
|
|
|
|
OpenBinaryFile(":cfgtests:appendtest.cfg", OPENMODE_OUT|OPENMODE_TRUNC);// clear content
|