Beispiel #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();
            }
        }
Beispiel #2
0
 internal DirectoryHandle(Impl.DirectoryAccessor directory)
 {
     Directory = directory;
 }
Beispiel #3
0
 public void NotifyCloseDirectory(DirectoryAccessor directory)
 {
     using ScopedLock <SdkMutexType> lk = ScopedLock.Lock(ref _openListLock);
     Remove(_openDirectories, directory);
 }