[Mono-bugs] [Bug 692445] New: Directory.GetFiles() throws UnauthorizedAccessException when there is not-permitted file

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun May 8 05:07:37 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=692445

https://bugzilla.novell.com/show_bug.cgi?id=692445#c0


           Summary: Directory.GetFiles() throws
                    UnauthorizedAccessException when there is
                    not-permitted file
    Classification: Mono
           Product: MonoDroid
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Class Libraries
        AssignedTo: mkestner at novell.com
        ReportedBy: aenomoto at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Do something like:

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            GetOggDirectories ("/");
        }

        IEnumerable<string> GetOggDirectories (string path)
        {
            foreach (var dir in Directory.EnumerateDirectories (path))
            {
                if (Directory.GetFiles (dir, "*.ogg").Any ())
                    yield return dir;
                foreach (var sub in GetOggDirectories (dir))
                    yield return sub;
            }
        }

This (likely) causes UnauthorizedAccessException (if there are
access-unauthorized file).

This makes Directory.GetFiles() kind of useless.

(Is it consistent with our usual behavior on linux?)

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list