Bug 3602 - System.IO.Directory.EnumerateFiles skips directories with names not having a dot in them??
Summary: System.IO.Directory.EnumerateFiles skips directories with names not having a ...
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 2.10.x
Hardware: PC Linux
: Normal major
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-22 20:32 UTC by Bill Fraser
Modified: 2016-04-16 08:29 UTC (History)
5 users (show)

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


Attachments
Example showing the bug (4.79 KB, application/x-zip-compressed)
2013-05-03 06:32 UTC, Jesper Kamstrup Linnet
Details


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 Bill Fraser 2012-02-22 20:32:47 UTC
Mono 2.10.8, Arch Linux

foreach (var file in Directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*", SearchOption.AllDirectories)) {
    Console.WriteLine(file);
}

% find .
.
./dir1
./dir1/dir2
./dir1/dir2/file
./dir1/dir2.2
./dir1/dir2.2/file
./dir1/file
./dir1.1
./dir1.1/dir2
./dir1.1/dir2/file
./dir1.1/dir2.2
./dir1.1/dir2.2/file
./dir1.1/file
./file

(all files are mode 0644 and all dirs are mode 0755, owner and group are myself)

% mono ~/enumFiles.exe
/home/wfraser/EnumerateFilesTest/dir1.1/dir2.2/file
/home/wfraser/EnumerateFilesTest/dir1.1/file
/home/wfraser/EnumerateFilesTest/file

It didn't descend into any directory lacking a dot in the name.
Running the same program in .NET prints all files.
Running in Mono and switching to GetFiles() prints all the files.
Comment 1 Marek Safar 2012-06-15 10:07:16 UTC
I cannot reproduce the issue with mono master. Please provide self contained test case
Comment 2 Jesper Kamstrup Linnet 2013-05-03 06:32:11 UTC
Created attachment 3911 [details]
Example showing the bug

Example project with directory structure reproducing the bug.
Comment 3 Jett Rink 2013-05-11 12:42:51 UTC
I am seeing the same behavior. I am targeting the .NET 4.0, and the versions I am using follow:

MonoDevelop 3.0.3.2
Runtime:
	Mono 2.10.8.1 (Debian 2.10.8.1-5ubuntu1) (64-bit)
	GTK 2.24.17
	GTK# (2.12.0.0)
Build information:
	Git revision: 7bf6ac0ca43c1b12703176ad9933c3484c05c84c-dirty
	Build date: 2012-08-24 05:44:11+0000
Operating System:
	Linux
	Linux home 3.8.0-19-generic #30-Ubuntu SMP Wed May 1 16:35:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Comment 4 Marek Safar 2016-04-16 08:29:15 UTC
Works as expected with Mono 4.4