Skip to content

A Nim library to create and manage temporary directories. Inspired by the Rust library of the same name: https://github.com/rust-lang-nursery/tempdir

License

Notifications You must be signed in to change notification settings

euantorano/tempdir.nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tempdir

A Nim library to create and manage temporary directories. Inspired by the Rust library of the same name.

Installation

nimble install tempdir

Or add the following to your .nimble file:

# Dependencies

requires "tempdir >= 1.0.1"

Usage

import tempdir

# Create a new temporary directory in the system's temporary directory path, with directories having the prefix `test`.
withTempDirectory(tmp, "test"):
  echo "Created temporary directory with path: ", tmp
  # At the end of this block, the temporary directory and all of its files will be deleted

# You can also create a temporary directory in a path of your choosing using the `createTempDirectory` procedure
let tmp2 = createTempDirectory("test", "./tmp")
echo "Created temporary directory with path: ", tmp2

About

A Nim library to create and manage temporary directories. Inspired by the Rust library of the same name: https://github.com/rust-lang-nursery/tempdir

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages