Esempio n. 1
0
        public DirectoryAccessor OpenDirectory(string path, OpenDirectoryMode mode)
        {
            IDirectory dir = FileSystem.OpenDirectory(path, mode);

            var accessor = new DirectoryAccessor(dir, this);

            lock (_locker)
            {
                OpenDirectories.Add(accessor);
            }

            return(accessor);
        }
Esempio n. 2
0
        public Result OpenDirectory(out DirectoryAccessor directory, U8Span path, OpenDirectoryMode mode)
        {
            directory = default;

            Result rc = FileSystem.OpenDirectory(out IDirectory rawDirectory, path, mode);

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

            var accessor = new DirectoryAccessor(rawDirectory, this);

            lock (_locker)
            {
                OpenDirectories.Add(accessor);
            }

            directory = accessor;
            return(Result.Success);
        }