Show / Hide Table of Contents

Class TemporaryDirectory

Represents a temporary directory that is automatically deleted when the object is disposed.

Inheritance
Object
TemporaryDirectory
TemporaryFlagFile
TemporaryWorkingDirectory
Namespace: NanoByte.Common.Storage
Assembly: NanoByte.Common.dll
Syntax
public class TemporaryDirectory : Object

Constructors

TemporaryDirectory(String, String)

Creates a uniquely named, empty temporary directory on disk.

Declaration
public TemporaryDirectory(string prefix, string parentDirectory = null)
Parameters
Type Name Description
String prefix

A short string the directory name should start with.

String parentDirectory

The path of the parent directory the new directory should be created in. Leave null to use the default temp directory.

Exceptions
Type Condition
IOException

A problem occurred while creating the temporary directory.

UnauthorizedAccessException

Creating a directory in GetTempPath() is not permitted.

Properties

Path

The fully qualified path of the temporary directory.

Declaration
public string Path { get; }
Property Value
Type Description
String

Methods

Dispose()

Deletes the temporary directory.

Declaration
public virtual void Dispose()

Operators

Implicit(TemporaryDirectory to String)

Declaration
public static implicit operator string (TemporaryDirectory dir)
Parameters
Type Name Description
TemporaryDirectory dir
Returns
Type Description
String

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher