internal void NotifyCloseFile(FileAccessor file) { lock (_locker) { OpenFiles.Remove(file); } }
public FileAccessor OpenFile(string path, OpenMode mode) { IFile file = FileSystem.OpenFile(path, mode); var accessor = new FileAccessor(file, this, mode); lock (_locker) { OpenFiles.Add(accessor); } return(accessor); }
public Result OpenFile(out FileAccessor file, U8Span path, OpenMode mode) { file = default; Result rc = FileSystem.OpenFile(out IFile rawFile, path, mode); if (rc.IsFailure()) { return(rc); } var accessor = new FileAccessor(rawFile, this, mode); lock (_locker) { OpenFiles.Add(accessor); } file = accessor; return(Result.Success); }
internal FileHandle(FileAccessor file) { File = file; }