public RamDir(string FName) { Info.FileAttributes = MemFsSharp.FileAttirutes.FILE_ATTRIBUTE_DIRECTORY; Childeren = new ConcurrentDictionary <string, FileObject>(StringComparer.OrdinalIgnoreCase); FileName = FName; Info.ChangeTime = WinFsp.GetFileTime(); Info.CreationTime = WinFsp.GetFileTime(); Info.LastAccessTime = WinFsp.GetFileTime(); Info.LastWriteTime = WinFsp.GetFileTime(); }
public RamFile(string FName) { Info.FileAttributes = (uint)FileAttributes.Normal; Info.ChangeTime = WinFsp.GetFileTime(); Info.CreationTime = WinFsp.GetFileTime(); Info.LastAccessTime = WinFsp.GetFileTime(); Info.LastWriteTime = WinFsp.GetFileTime(); FileData = new MemoryStream(); FileName = FName; }
private void InitFsp() { Fsp = new WinFsp(Config, this, null, null); FsVolumeInfo = new VolInfo(); FsVolumeInfo.FreeSize = (ulong)1024 * 1024 * 1024 * 10; FsVolumeInfo.TotalSize = (ulong)1024 * 1024 * 1024 * 10; FsVolumeInfo.VolumeLable = "InfyCloud"; rootDirectory = new RamDir("\\"); _fileObjects.TryAdd("\\", rootDirectory); _fileObjects.TryAdd("", rootDirectory); }
public uint Overwrite(WinFspFileSystem FileSystem, FileOpenContext Context, uint FileAttributes, bool ReplaceFileAttributes) { if (Context.Node.UserContext == null) { return(NtStatus.STATUS_INVALID_PARAMETER); } var file = Context.Node.UserContext as FileObject; Trace.WriteLine($"Overwrite FileName {file.FileName} fileFound {file != null}"); file.Info.FileSize = 0; file.Info.LastAccessTime = file.Info.LastWriteTime = WinFsp.GetFileTime(); return(NtStatus.STATUS_SUCCESS); }