JobManager/Archiver/Lib/TempFile.cs
2024-06-01 20:41:42 +09:00

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);
}
}