File:
[parser3project] /
parser3 /
tests /
164.html
Revision
1.5:
download - view:
text,
annotated -
select for diffs -
revision graph
Mon Apr 23 15:23:04 2007 UTC (19 years, 2 months ago) by
misha
Branches:
MAIN
CVS tags:
release_3_5_1,
release_3_5_0,
release_3_4_6,
release_3_4_5,
release_3_4_4,
release_3_4_3,
release_3_4_2,
release_3_4_1,
release_3_4_0,
release_3_3_0,
release_3_2_3,
release_3_2_2,
HEAD
no message
@main[]
$sName[164_dir/hf]
^$hf[^^hashfile::open[$sName]]
$hf[^hashfile::open[$sName]]
^checkFiles[$sName]
<hr />
Storing 4 values and show all items...<br />
^put[$hf;0;value 0;^date::now(+2/24/60/60)]
^put[$hf;1;value 1](2)
^put[$hf;2;value 2](5)
^put[$hf;3;value 3](6)
^print[$hf]
<hr />
Checking files after storing data...
^checkFiles[$sName]
<hr />
Removing locks...
<br />^^hf.release[]
^hf.release[]
<hr />
Removing one value and show all items...<br />
^hf.delete[3]
^print[$hf]
<hr />
Waiting for a 3 secs and show all items...
^sleep(3)
^print[$hf]
<hr />
Scan for expired items...
<br />^^hf.cleanup[]
^hf.cleanup[]
^checkFiles[$sName]
<hr />
Delete files and check if they exists...
<br />^^hf.delete[]
^hf.delete[]
^checkFiles[$sName]
<hr />
Put value and check auto re-opening...
^put[$hf;1;value 1]
^checkFiles[$sName]
# finalizing: remove files for make next test start working well
^hf.delete[]
@put[hf;sKey;sValue;uExpires]
$hf.$sKey[
$.value[$sValue]
^if(def $uExpires){
^if($uExpires is "date"){
$.expires[$uExpires]
}{
$.expires($uExpires/24/60/60)
}
}
]
@print[hf;sText][sKey;sValue]
<p>^if(def $sText){$sText<br />}
^hf.foreach[sKey;sValue]{^$hf.${sKey}: '$sValue'}[<br />]
</p>
@checkFiles[sName]
<p>
${sName}.dir file ^checkFile[${sName}.dir]<br />
${sName}.pag file ^checkFile[${sName}.dir]
</p>
@checkFile[sFileName]
^if(!-f $sFileName){doesn't }exist
E-mail: