JobManager/ProtocolLib/PacketIO/TempFile.cs
2024-06-01 20:40:56 +09:00

22 lines
343 B
C#

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