[Mono-list] DirectoryInfo.GetFiles() bug?

place psiplace at netscape.net
Wed Jan 23 15:23:56 EST 2008




> 
> What filename is it you're expecting it to find that it isn't finding?
> 
> Alan.
> 

i traced it to all files without an extension, i was searching a backup of
250,000 odd files, of which i was getting a couple of hundred missing.


Alan McGovern-2 wrote:
> 
> Are you sure that's a bug? '*.*' will look for every file which contains a
> '.' character in it. If you want all files, you should just use ' * ', or
> leave out the mask altogether.
> 

yes that is what happens under mono, but not under windows, '*.*' finds all
files, what im guessing now is that a dot is always assumed to be present
(with directories too!!), and that dotnet is continuing this. So the
extension is not just part of the name but has special rules.

anyway i've now programmed round this, because of this and another
peculiarity, i discovered, with the wildcard system; three letter extensions
being treated as a special case, again for backward compat, and also
something about not searching past the first 8 chars, at which point i gave
up trying to work it out and just did it myself, doesn't seem to be
noticeably slower.

i'd recommend everyone not to use this parameter.
-- 
View this message in context: http://www.nabble.com/DirectoryInfo.GetFiles%28%29--bug--tp15023561p15051329.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list