NanoByte.Common
Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | List of all members
NanoByte.Common.Storage.TemporaryFile Class Reference

Disposable class to create a temporary file and delete it again when disposed. More...

Inheritance diagram for NanoByte.Common.Storage.TemporaryFile:

Public Member Functions

 TemporaryFile ([Localizable(false)] string prefix)
 Creates a uniquely named, empty temporary file on disk. More...
 
void Dispose ()
 Deletes the temporary file. More...
 

Static Public Member Functions

static implicit operator string (TemporaryFile file)
 

Protected Member Functions

virtual void Dispose (bool disposing)
 

Properties

string Path [get]
 The fully qualified path of the temporary file. More...
 

Detailed Description

Disposable class to create a temporary file and delete it again when disposed.

Constructor & Destructor Documentation

◆ TemporaryFile()

NanoByte.Common.Storage.TemporaryFile.TemporaryFile ( [Localizable(false)] string  prefix)
inline

Creates a uniquely named, empty temporary file on disk.

Parameters
prefixA short string the directory name should start with.
Exceptions
IOExceptionA problem occurred while creating a file in System.IO.Path.GetTempPath.
UnauthorizedAccessExceptionCreating a file in System.IO.Path.GetTempPath is not permitted.

Member Function Documentation

◆ Dispose()

void NanoByte.Common.Storage.TemporaryFile.Dispose ( )
inline

Deletes the temporary file.

Property Documentation

◆ Path

string NanoByte.Common.Storage.TemporaryFile.Path
get

The fully qualified path of the temporary file.


The documentation for this class was generated from the following file: