Example #1
0
 internal void NotifyCloseFile(FileAccessor file)
 {
     lock (_locker)
     {
         OpenFiles.Remove(file);
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 internal FileHandle(FileAccessor file)
 {
     File = file;
 }