Exemplo n.º 1
0
        public Result OpenDirectory(out DirectoryAccessor directory, U8Span path, OpenDirectoryMode mode)
        {
            UnsafeHelpers.SkipParamInit(out directory);

            Result rc = CheckPath(new U8Span(_mountName.Name), path);

            if (rc.IsFailure())
            {
                return(rc);
            }

            IDirectory iDirectory = null;

            try
            {
                rc = _fileSystem.OpenDirectory(out iDirectory, path, mode);
                if (rc.IsFailure())
                {
                    return(rc);
                }

                var directoryAccessor = new DirectoryAccessor(ref iDirectory, this);

                using (ScopedLock.Lock(ref _openListLock))
                {
                    _openDirectories.AddLast(directoryAccessor);
                }

                directory = Shared.Move(ref directoryAccessor);
                return(Result.Success);
            }
            finally
            {
                iDirectory?.Dispose();
            }
        }
Exemplo n.º 2
0
 internal DirectoryHandle(Impl.DirectoryAccessor directory)
 {
     Directory = directory;
 }
Exemplo n.º 3
0
 public void NotifyCloseDirectory(DirectoryAccessor directory)
 {
     using ScopedLock <SdkMutexType> lk = ScopedLock.Lock(ref _openListLock);
     Remove(_openDirectories, directory);
 }