Class TempFile
Creates unique name for a temporary file and later auto-deletes the file.
public sealed class TempFile : IDisposable
Remarks
Use code like in the example to auto-delete the temporary file if exists. Or call Dispose. Else this class does not delete the file.
Examples
using (var f = new TempFile()) {
print.it(f);
filesystem.saveText(f, "DATA");
print.it(filesystem.loadText(f));
} //now auto-deletes the file
Namespace: Au.More
Assembly: Au.dll
Constructors
| Name | Description |
|---|---|
| TempFile(string, string) | Creates full path string with a unique filename (GUID) for a temporary file. |
Properties
| Name | Description |
|---|---|
| File | Gets the file path. |
Methods
| Name | Description |
|---|---|
| Dispose() | Deletes the file if exists. |
| ToString() | Returns the file path. |
Operators
| Name | Description |
|---|---|
| implicit operator string(TempFile) | Returns the file path. |