check point
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user