NanoByte.Common  2.9.0
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...
 
virtual void Dispose ()
 Deletes the temporary file. More...
 

Static Public Member Functions

static implicit operator string (TemporaryFile file)
 

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()

virtual void NanoByte.Common.Storage.TemporaryFile.Dispose ( )
inlinevirtual

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: