Bug 2975 - System.IO.Directory.EnumerateFiles doesn't return any file
Summary: System.IO.Directory.EnumerateFiles doesn't return any file
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-01-19 18:42 UTC by Fabien GIGANTE
Modified: 2012-06-15 11:17 UTC (History)
7 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Fabien GIGANTE 2012-01-19 18:42:59 UTC
System.IO.Directory.EnumerateFiles doesn't return any file when invoked with an absolute path as argument. However GetFiles with the same arguments works correctly. This can be easily reproduced using the C# shell as follows:

csharp> foreach(string s in System.IO.Directory.GetFiles("c:\\")) Console.WriteL
ine(s);
[list of files is dislayed]

csharp> foreach(string s in System.IO.Directory.EnumerateFiles("c:\\")) Console.
WriteLine(s);
csharp>
Comment 1 David McNicol 2012-02-02 09:33:29 UTC
During development and testing on Ubuntu 10.04.3, Mono runtime 2.10.5, I have found that System.IO.Directory.EnumerateFiles returned some of the files from the absolute path, but not all.

System.IO.Directory.GetFiles did return a complete set of files and directories.
Comment 2 Aaron Bockover 2012-05-23 18:42:18 UTC
I'm seeing this as well on Mono for Android 4.0.6.52253989.

Directory.GetFiles("/mnt/sdcard/Android/<our-app>/") -> returns entries as expected
Directory.EnumerateFiles("/mnt/sdcard/Android/<our-app>/") -> yields nothing

There also appear to be 0 EnumerateFiles tests in mcs/class/corlib/Test/System.IO, but grep reports 55 instances of GetFiles somewhere in that directory...
Comment 3 Marek Safar 2012-06-15 11:17:05 UTC
It should be fixed in master