From: "Vít Ondruch" Date: 2011-01-30T01:33:33+09:00 Subject: [ruby-core:34979] Re: [Ruby 1.9-Bug#4343] Dir.glob does match files without extension Dne 29.1.2011 17:27, Jeremy Bopp napsal(a): > On 01/29/2011 10:19 AM, Nobuyoshi Nakada wrote: >> Issue #4343 has been updated by Nobuyoshi Nakada. >> >> >>> Why there is for the first case listed "bla." instead of just "bla". >> Because you gave "bla.". Dir.glob respects the given pattern as possible. >> And "bla." and "bla" are same on NTFS. > Wouldn't that fact imply that "bla.*" should also match "bla" in that > case? I think that is where the confusion lies. Some globs, such as > "bla.*", won't match "bla" while others, such as "bla.", will match. > > I would argue that for compatibility reasons, globbing on "bla." should > *not* match even on Windows. Globbing under the Windows cmd shell is > different than under Unix shells, but Ruby should enforce a single > globbing strategy for all supported platforms for consistency. > > -Jeremy > Well ruby should enforce as much as it can, but you should remember that while you can do this on linux: vita@vita-desktop:~$ echo something > bla vita@vita-desktop:~$ echo something > bla. vita@vita-desktop:~$ ls bla* bla bla. the windows version will have different result no matter what: C:\temp>echo something > bla C:\temp>echo something > bla. C:\temp>dir bla* Svazek v jednotce C je Windows7_x64_OS. S��riov�� ����slo svazku je 2C6E-5F69. V��pis adres����e C:\temp 29.01.2011 17:31 12 bla Soubor��: 1, Bajt��: 12 Adres������: 0, Voln��ch bajt��: 21 459 759 104 C:\temp>dir bla*.* Svazek v jednotce C je Windows7_x64_OS. S��riov�� ����slo svazku je 2C6E-5F69. V��pis adres����e C:\temp 29.01.2011 17:31 12 bla Soubor��: 1, Bajt��: 12 Adres������: 0, Voln��ch bajt��: 21 459 759 104