Skip to content

Commit 4cc2824

Browse files
authored
Merge pull request #2 from cghdev/hidden
Show hidden and system files/directories in NTFS volumes
2 parents 96cda14 + 0ff50e6 commit 4cc2824

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Program.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using DiscUtils.Ebs;
55
using DiscUtils.Setup;
66
using DiscUtils.Streams;
7+
using DiscUtils.Ntfs;
78
using Mono.Options;
89
using System;
910
using System.Linq;
@@ -150,7 +151,11 @@ static void Main(string[] args) {
150151

151152
var fsInfo = FileSystemManager.DetectFileSystems(sparseStream);
152153
var fs = fsInfo[0].Open(sparseStream);
153-
154+
if (fs is NtfsFileSystem)
155+
{
156+
((NtfsFileSystem)fs).NtfsOptions.HideHiddenFiles = false;
157+
((NtfsFileSystem)fs).NtfsOptions.HideSystemFiles = false;
158+
}
154159
if (command == "ls") {
155160

156161
foreach (var file in fs.GetDirectories(filePath)) {
@@ -277,6 +282,11 @@ private static void Ui_ItemSelected(string itemValue) {
277282
CurrentFileSystem = fsInfo[0].Open(sparseStream);
278283
CurrentPath = "";
279284
UI.VolumeLabel = $"Volume: {CurrentFileSystem.FriendlyName} {GetHumanSize(CurrentFileSystem.Size)}";
285+
if (CurrentFileSystem is NtfsFileSystem)
286+
{
287+
((NtfsFileSystem)CurrentFileSystem).NtfsOptions.HideHiddenFiles = false;
288+
((NtfsFileSystem)CurrentFileSystem).NtfsOptions.HideSystemFiles = false;
289+
}
280290
UpdateView();
281291
}
282292
}

0 commit comments

Comments
 (0)