From f2a2d27dc5278138c9dc8bb592a0ca93eea66a52 Mon Sep 17 00:00:00 2001 From: Grigory Chudov Date: Mon, 1 Jul 2013 20:22:57 -0400 Subject: [PATCH] CUETools: Don't abort folder scan when failed to read attributes of a file, for example a symlink to an inaccessible target. --- CUETools.Processor/CUESheet.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CUETools.Processor/CUESheet.cs b/CUETools.Processor/CUESheet.cs index a503f58..f340520 100644 --- a/CUETools.Processor/CUESheet.cs +++ b/CUETools.Processor/CUESheet.cs @@ -4091,8 +4091,16 @@ namespace CUETools.Processor { // file.Refresh(); // file.Attributes returns -1 for long paths!!! - if ((file.Attributes & FileAttributes.Hidden) != 0) + try + { + + if ((file.Attributes & FileAttributes.Hidden) != 0) + continue; + } + catch (UnauthorizedAccessException) + { continue; + } if ((file.Attributes & FileAttributes.Directory) != 0) { // foreach (FileSystemInfo subfile in ((DirectoryInfo)e.file).GetFileSystemInfos())