Import std.io.temp
TempDir
class
Public Class TempDir
A new, empty folder of the program's own, which Close removes with everything in it.
Examples
Local folder = Try TempDir("example-")
Try File.WriteText(folder.Path / "a.txt", "a")
Expect(folder.Path.FileName().StartsWith("example-"))
Try folder.Close()
Expect(!Dir.Exists(folder.Path))-
Where the folder is.
-
Makes one named
prefixand six letters and digits. -
Removes the folder and everything in it, which a second Close leaves alone. One that fails, as when a file in it is still open on Windows, can be tried again.
Report an issue with this page or with FutureBlitz on GitHub.