Exemplo n.º 1
0
        public override List <FileSystemEntry> ListEntriesInDirectory(string path)
        {
            FileRecord directoryRecord = m_volume.GetFileRecord(path);

            if (!directoryRecord.IsDirectory)
            {
                throw new InvalidPathException(String.Format("'{0}' is not a directory", path));
            }

            KeyValuePairList <MftSegmentReference, FileNameRecord> records = m_volume.GetFileNameRecordsInDirectory(directoryRecord.BaseSegmentReference);
            List <FileSystemEntry> result = new List <FileSystemEntry>();

            path = FileSystem.GetDirectoryPath(path);

            foreach (FileNameRecord record in records.Values)
            {
                string          fullPath = path + record.FileName;
                FileSystemEntry entry    = ToFileSystemEntry(fullPath, record);
                result.Add(entry);
            }
            return(result);
        }
Exemplo n.º 2
0
        public override List <FileSystemEntry> ListEntriesInDirectory(string path)
        {
            FileRecord directoryRecord = m_volume.GetFileRecord(path);

            if (directoryRecord != null && directoryRecord.IsDirectory)
            {
                KeyValuePairList <MftSegmentReference, FileNameRecord> records = m_volume.GetFileNameRecordsInDirectory(directoryRecord.BaseSegmentReference);
                List <FileSystemEntry> result = new List <FileSystemEntry>();

                path = FileSystem.GetDirectoryPath(path);

                foreach (FileNameRecord record in records.Values)
                {
                    string          fullPath = path + record.FileName;
                    FileSystemEntry entry    = ToFileSystemEntry(fullPath, record);
                    result.Add(entry);
                }
                return(result);
            }
            else
            {
                return(null);
            }
        }