Update.
This commit is contained in:
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
|
||||
import "tempfile" for TempFile
|
||||
import "io" for File
|
||||
import "pathlib" for Path
|
||||
|
||||
var path = TempFile.mkstemp()
|
||||
System.print(path is String) // expect: true
|
||||
System.print(Path.new(path).exists()) // expect: true
|
||||
|
||||
File.delete(path)
|
||||
System.print(Path.new(path).exists()) // expect: false
|
||||
|
||||
var path2 = TempFile.mkstemp(".txt")
|
||||
System.print(path2.endsWith(".txt")) // expect: true
|
||||
File.delete(path2)
|
||||
|
||||
var path3 = TempFile.mkstemp(".dat", "test_")
|
||||
System.print(path3.contains("test_")) // expect: true
|
||||
System.print(path3.endsWith(".dat")) // expect: true
|
||||
File.delete(path3)
|
||||
Reference in New Issue
Block a user