22 lines
347 B
C#
22 lines
347 B
C#
|
namespace Archiver.Lib;
|
||
|
|
||
|
public class TempFile : IDisposable
|
||
|
{
|
||
|
public string FileName { get; }
|
||
|
|
||
|
public TempFile()
|
||
|
{
|
||
|
FileName = Path.GetTempFileName();
|
||
|
}
|
||
|
|
||
|
public Stream Open(FileMode mode)
|
||
|
{
|
||
|
return new FileStream(FileName, mode);
|
||
|
}
|
||
|
|
||
|
public void Dispose()
|
||
|
{
|
||
|
File.Delete(FileName);
|
||
|
}
|
||
|
}
|