Provides a mechanism to create, read and write a temporary file which is automatically removed at disposal time.
More...
|
| AutoTempFile () |
| Default constructor: creates the temp file with no data and no naming hints using the OS-level temporary filename generator.
|
| AutoTempFile (byte[] data) |
| Constructs a new AutoTempFile with the provided binary data. The file name is generated by the operating system.
|
| AutoTempFile (string data) |
| Constructs a new AutoTempFile with the provided string data. The file name is generated by the operating system.
|
| AutoTempFile (string baseFolder, string data) |
| Constructs a new AutoTempFile in the specified baseFolder with the provided string data.
|
| AutoTempFile (string baseFolder, string fileName, string data) |
| Constructs a new AutoTempFile in the provided folder with the provided name, containing the provided string data.
|
| AutoTempFile (string baseFolder, byte[] data) |
| Constructs a new AutoTempFile in the specified baseFolder with the provided binary data.
|
| AutoTempFile (string baseFolder, string fileName, byte[] data) |
| Constructs a new AutoTempFile in the provided folder with the provided name, containing the provided binary data.
|
void | Delete () |
| Deletes the temp file, if found, otherwise does nothing.
|
void | Dispose () |
|
int | RetryOperations [get, set] |
| How many times to retry operations if they fail.
|
string | Path [get] |
| Provides the path to the temporary file on disk.
|
byte[] | BinaryData [get, set] |
| Reads and writes binary data from and to the file.
|
string | StringData [get, set] |
| Reads and writes string data from and to the file.
|
Provides a mechanism to create, read and write a temporary file which is automatically removed at disposal time.
◆ AutoTempFile() [1/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
byte[] | data | ) |
|
Constructs a new AutoTempFile with the provided binary data. The file name is generated by the operating system.
- Parameters
-
◆ AutoTempFile() [2/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
string | data | ) |
|
Constructs a new AutoTempFile with the provided string data. The file name is generated by the operating system.
- Parameters
-
◆ AutoTempFile() [3/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
string | baseFolder, |
|
|
string | data ) |
Constructs a new AutoTempFile in the specified baseFolder with the provided string data.
- Parameters
-
baseFolder | Folder to create the file within |
data | String data to initialize the file with |
◆ AutoTempFile() [4/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
string | baseFolder, |
|
|
string | fileName, |
|
|
string | data ) |
Constructs a new AutoTempFile in the provided folder with the provided name, containing the provided string data.
- Parameters
-
baseFolder | Folder to create the file within |
fileName | Name to use for the file |
data | String data to initialize the file with (will be encoded utf-8) |
◆ AutoTempFile() [5/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
string | baseFolder, |
|
|
byte[] | data ) |
Constructs a new AutoTempFile in the specified baseFolder with the provided binary data.
- Parameters
-
baseFolder | Folder to create the file within |
data | Binary data to initialize the file with |
◆ AutoTempFile() [6/6]
PeanutButter.Utils.AutoTempFile.AutoTempFile |
( |
string | baseFolder, |
|
|
string | fileName, |
|
|
byte[] | data ) |
Constructs a new AutoTempFile in the provided folder with the provided name, containing the provided binary data.
- Parameters
-
baseFolder | Folder to create the file within |
fileName | Name to use for the file |
data | Binary data to initialize the file with |
◆ RetryOperations
int PeanutButter.Utils.AutoTempFile.RetryOperations |
|
getset |
How many times to retry operations if they fail.
- operations like read and write are retried on failure as I've seen antivirus hold onto files ):
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/AutoTempFile.cs