Update.
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "tempfile" for NamedTemporaryFile
|
||||
import "pathlib" for Path
|
||||
|
||||
var savedName = null
|
||||
|
||||
NamedTemporaryFile.new().use {|tmp|
|
||||
tmp.write("inside use block")
|
||||
var content = tmp.read()
|
||||
System.print(content) // expect: inside use block
|
||||
savedName = tmp.name
|
||||
}
|
||||
|
||||
System.print(Path.new(savedName).exists()) // expect: false
|
||||
Reference in New Issue
Block a user