Skip to content

Commit 266c884

Browse files
committed
IFileSystem: Added ListDataStreams method
1 parent 07af228 commit 266c884

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

Utilities/IFileSystem/FileSystem.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ public List<FileSystemEntry> ListEntriesInRootDirectory()
2222
return ListEntriesInDirectory(@"\");
2323
}
2424

25+
public virtual List<KeyValuePair<string, ulong>> ListDataStreams(string path)
26+
{
27+
FileSystemEntry entry = GetEntry(path);
28+
List<KeyValuePair<string, ulong>> result = new List<KeyValuePair<string, ulong>>();
29+
if (!entry.IsDirectory)
30+
{
31+
result.Add(new KeyValuePair<string, ulong>("::$DATA", entry.Size));
32+
}
33+
return result;
34+
}
35+
2536
public Stream OpenFile(string path, FileMode mode, FileAccess access, FileShare share)
2637
{
2738
return OpenFile(path, mode, access, share, FileOptions.None);

Utilities/IFileSystem/IFileSystem.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public interface IFileSystem
4545
/// <exception cref="System.UnauthorizedAccessException"></exception>
4646
List<FileSystemEntry> ListEntriesInDirectory(string path);
4747

48+
/// <exception cref="System.ArgumentException"></exception>
49+
/// <exception cref="System.IO.DirectoryNotFoundException"></exception>
50+
/// <exception cref="System.IO.FileNotFoundException"></exception>
51+
/// <exception cref="System.IO.IOException"></exception>
52+
/// <exception cref="System.UnauthorizedAccessException"></exception>
53+
List<KeyValuePair<string, ulong>> ListDataStreams(string path);
54+
4855
/// <exception cref="System.ArgumentException"></exception>
4956
/// <exception cref="System.IO.DirectoryNotFoundException"></exception>
5057
/// <exception cref="System.IO.FileNotFoundException"></exception>

0 commit comments

Comments
 (0)