Skip to content
FutureBlitz

    Install

    Import std.io.temp

    TempDir

    std.io.temp

    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))

    std/io/temp.fb, line 30

    • Public ReadOnly Field Path: Path field #

      Where the folder is.

    • Public New(prefix: String = "fb-") Throws IOError constructor #

      Makes one named prefix and six letters and digits.

    • Public Method Close() Throws IOError method #

      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.