PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.AutoDeleter Class Reference

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...

Inheritance diagram for PeanutButter.Utils.AutoDeleter:

Public Member Functions

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ AutoDeleter()

PeanutButter.Utils.AutoDeleter.AutoDeleter ( params string[] paths)

Constructs a new AutoDeleter with zero or more paths to delete upon disposal.

Parameters
pathsParams array of paths to delete upon disposal

Member Function Documentation

◆ Add()

void PeanutButter.Utils.AutoDeleter.Add ( params string[] paths)

Adds zero or more paths to the list to delete upon disposal.

Parameters
pathsParams 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