RosettaCodeData/Task/Secure-temporary-file/PicoLisp/secure-temporary-file.l

13 lines
343 B
Text
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
: (out (tmp "foo") (println 123)) # Write tempfile
-> 123
: (in (tmp "foo") (read)) # Read tempfile
-> 123
: (let F (tmp "foo")
(ctl F # Get exclusive lock
2018-06-22 20:57:24 +00:00
(in F
(let N (read) # Atomic increment
(out F (println (inc N))) ) ) ) )
2013-04-10 23:57:08 -07:00
-> 124