Provides a mechanism to autmatically delete one or more files using the IDisposable pattern. Use this when you'd like to clean up some temporary files after an operation completes without having to worry about exception handling, etc. Files which cannot be deleted (eg: locked for reading / writing) will be left behind. No exceptions are thrown. Files which have been removed in the interim do not cause any exceptions.
More...
|
| AutoDeleter (params string[] paths) |
| Constructs a new AutoDeleter with zero or more paths to delete upon disposal.
|
void | Add (params string[] paths) |
| Adds zero or more paths to the list to delete upon disposal.
|
void | Dispose () |
Provides a mechanism to autmatically delete one or more files using the IDisposable pattern. Use this when you'd like to clean up some temporary files after an operation completes without having to worry about exception handling, etc. Files which cannot be deleted (eg: locked for reading / writing) will be left behind. No exceptions are thrown. Files which have been removed in the interim do not cause any exceptions.
◆ AutoDeleter()
PeanutButter.Utils.AutoDeleter.AutoDeleter |
( |
params string[] | paths | ) |
|
Constructs a new AutoDeleter with zero or more paths to delete upon disposal.
- Parameters
-
paths | Params array of paths to delete upon disposal |
◆ Add()
void PeanutButter.Utils.AutoDeleter.Add |
( |
params string[] | paths | ) |
|
Adds zero or more paths to the list to delete upon disposal.
- Parameters
-
paths | Params array of paths to add to the list to delete upon disposal |
The documentation for this class was generated from the following file:
- source/Utils/PeanutButter.Utils/AutoDeleter.cs