Show / Hide Table of Contents

Class TemporaryFile

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

Inheritance
Object
TemporaryFile
Namespace: NanoByte.Common.Storage
Assembly: NanoByte.Common.dll
Syntax
public class TemporaryFile : Object

Constructors

TemporaryFile(String, String)

Creates a uniquely named, empty temporary file on disk.

Declaration
public TemporaryFile(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 directory the file should be created in. Leave null to use the default temp directory.

Exceptions
Type Condition
IOException

A problem occurred while creating the temporary file.

UnauthorizedAccessException

Creating a file in GetTempPath() is not permitted.

Properties

Path

The fully qualified path of the temporary file.

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

Methods

Dispose()

Deletes the temporary file.

Declaration
public virtual void Dispose()

Operators

Implicit(TemporaryFile to String)

Declaration
public static implicit operator string (TemporaryFile file)
Parameters
Type Name Description
TemporaryFile file
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