This commit is contained in:
2026-01-25 04:58:39 +01:00
parent 957e3a4762
commit 2e425571ca
139 changed files with 5078 additions and 73 deletions
+18
View File
@@ -0,0 +1,18 @@
// retoor <retoor@molodetz.nl>
import "tempfile" for NamedTemporaryFile
import "pathlib" for Path
var tmp = NamedTemporaryFile.new()
System.print(tmp.name is String) // expect: true
System.print(Path.new(tmp.name).exists()) // expect: true
System.print(tmp.closed) // expect: false
System.print(tmp.delete) // expect: true
tmp.write("hello tempfile")
var content = tmp.read()
System.print(content) // expect: hello tempfile
tmp.close()
System.print(tmp.closed) // expect: true
System.print(Path.new(tmp.name).exists()) // expect: false