TemporaryDirectory 0.0.1
See the version list below for details.
dotnet add package TemporaryDirectory --version 0.0.1
NuGet\Install-Package TemporaryDirectory -Version 0.0.1
<PackageReference Include="TemporaryDirectory" Version="0.0.1" />
paket add TemporaryDirectory --version 0.0.1
#r "nuget: TemporaryDirectory, 0.0.1"
// Install TemporaryDirectory as a Cake Addin #addin nuget:?package=TemporaryDirectory&version=0.0.1 // Install TemporaryDirectory as a Cake Tool #tool nuget:?package=TemporaryDirectory&version=0.0.1
<h1 align="center">Temporary Directory .Net Core</h1>
<p align="center">⚡ Working with temporary directory made easy ☕️</p>
**Temporary Directory ** is a simple to work with temporary directory for .Net Core developers.
🔧 Installation
Using the .NET Core command-line interface (CLI) tools:
$ dotnet add package XXX
or with the Package Manager Console:
$ Install-Package XXX
🚀 Usage
Creating temporary directory
To create a temporary directory at the system temporary directory call the create method:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();
Naming temporary directory
To create a temporary directory with a specific name:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().SetName("MyFolder").Create();
Force creating temporary directory
In case the directory already exists you can force create the directory. It will delete the old folder and create the directory againg:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().SetName("MyFolder").SetForce(true).Create();
Creating temporary directory a custom location
If you wise to create the folder at another location you can specify this in the constructor:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler(location).Create();
Retrive the path of the temporary directory
You can use the method GetPath to either get the path of the directory or a specific file:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();
string path = directory.GetPath();
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();
string path = directory.GetPath("my-file.txt");
Empty temporary directory
You can empty a directory with method Empty:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();
directory.Empty();
Delete temporary directory
You can delete a directory with method Empty:
TemporaryDirectoryHandler directory = new TemporaryDirectoryHandler().Create();
bool result = directory.Delete();
🤼 How to Contribute
Feel free to contribute with pull requests, bug reports or enhancement suggestions. We love PR's
🎉 Credits
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.