Annotation of parser3/tests/164.html, revision 1.4
1.1 misha 1: @main[]
2: $sName[164_dir/hf]
3:
4: ^$hf[^^hashfile::open[$sName]]
5: $hf[^hashfile::open[$sName]]
6:
7: ^checkFiles[$sName]
8:
9: <hr />
1.2 misha 10: Storing 4 values and show all items...<br />
1.3 misha 11: ^put[$hf;0;value 0](2)
1.4 ! misha 12: ^put[$hf;1;value 1;^date::now(+2/24/60/60)]
! 13: ^put[$hf;2;value 2](4)
! 14: ^put[$hf;3;value 3](5)
1.1 misha 15: ^print[$hf]
16:
17: <hr />
18: Checking files after storing data...
19: ^checkFiles[$sName]
20:
21: <hr />
22: Removing locks...
23: <br />^^hf.release[]
24: ^hf.release[]
25:
26: <hr />
27: Removing one value and show all items...<br />
28: ^hf.delete[3]
29: ^print[$hf]
30:
31: <hr />
1.4 ! misha 32: Waiting for a 3 secs and show all items...
! 33: ^sleep(3)
1.1 misha 34: ^print[$hf]
35:
36: <hr />
37: Scan for expired items...
38: <br />^^hf.cleanup[]
39: ^hf.cleanup[]
40: ^checkFiles[$sName]
41:
42: <hr />
43: Delete files and check if they exists...
44: <br />^^hf.delete[]
45: ^hf.delete[]
46: ^checkFiles[$sName]
47:
48: <hr />
49: Put value and check auto re-opening...
1.3 misha 50: ^put[$hf;1;value 1]
1.1 misha 51: ^checkFiles[$sName]
52:
53: # finalizing: remove files for make next test start working well
54: ^hf.delete[]
55:
56:
57:
1.2 misha 58: @put[hf;sKey;sValue;uExpires]
1.1 misha 59: $hf.$sKey[
60: $.value[$sValue]
1.3 misha 61: ^if(def $uExpires){
62: ^if($uExpires is "date"){
63: $.expires[$uExpires]
64: }{
65: $.expires($uExpires/24/60/60)
66: }
1.2 misha 67: }
1.1 misha 68: ]
69:
70:
71: @print[hf;sText][sKey;sValue]
72: <p>^if(def $sText){$sText<br />}
73: ^hf.foreach[sKey;sValue]{^$hf.${sKey}: '$sValue'}[<br />]
74: </p>
75:
76:
77:
78: @checkFiles[sName]
79: <p>
80: ${sName}.dir file ^checkFile[${sName}.dir]<br />
81: ${sName}.pag file ^checkFile[${sName}.dir]
82: </p>
83:
84:
85:
86: @checkFile[sFileName]
87: ^if(!-f $sFileName){doesn't }exist
E-mail: