Update.
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "tempfile" for TemporaryDirectory
|
||||
import "io" for File, FileFlags
|
||||
import "pathlib" for Path
|
||||
|
||||
var savedName = null
|
||||
|
||||
TemporaryDirectory.new().use {|tmp|
|
||||
savedName = tmp.name
|
||||
System.print(Path.new(savedName).isDir()) // expect: true
|
||||
|
||||
var filePath = savedName + "/test.txt"
|
||||
File.create(filePath) {|f|
|
||||
f.writeBytes("hello", 0)
|
||||
}
|
||||
System.print(Path.new(filePath).exists()) // expect: true
|
||||
}
|
||||
|
||||
System.print(Path.new(savedName).exists()) // expect: false
|
||||
Reference in New Issue
Block a user