Files
HawkeyeVision/framework/Inspectron.Fastbuffer/Filesystems/DirectFilesystem.cs
2025-07-14 12:03:59 +02:00

31 lines
624 B
C#

using Inspectron.Fastbuffer.Interfaces;
using Serilog;
namespace Inspectron.Fastbuffer.Filesystems;
public class DirectFilesystem:IFilesystem
{
public void Write(string path, byte[] data)
{
// ensure path
Directory.CreateDirectory(Path.GetDirectoryName(path));
File.WriteAllBytes(path, data);
}
public byte[] Read(string path)
{
return File.ReadAllBytes(path);
}
public void Delete(string path)
{
Log.Debug($"Deleting {path}");
if (File.Exists(path))
File.Delete(path);
}
public void Dispose()
{
}
}