From: Andrew Vos Date: 2011-01-30T01:37:30+09:00 Subject: [ruby-core:34980] Re: [Ruby 1.9-Bug#4343] Dir.glob does match files without extension --0016367b664e5dc9ba049afecc9d Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Is this not a windows issue? On Sat, Jan 29, 2011 at 4:33 PM, V=EDt Ondruch wrote: > 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=E9riov=E9 =E8=EDslo svazku je 2C6E-5F69. > > V=FDpis adres=E1=F8e C:\temp > > 29.01.2011 17:31 12 bla > Soubor=F9: 1, Bajt=F9: 12 > Adres=E1=F8=F9: 0, Voln=FDch bajt=F9: 21 459 759 104 > > C:\temp>dir bla*.* > > Svazek v jednotce C je Windows7_x64_OS. > S=E9riov=E9 =E8=EDslo svazku je 2C6E-5F69. > > V=FDpis adres=E1=F8e C:\temp > > 29.01.2011 17:31 12 bla > Soubor=F9: 1, Bajt=F9: 12 > Adres=E1=F8=F9: 0, Voln=FDch bajt=F9: 21 459 759 104 > > > > > > > --0016367b664e5dc9ba049afecc9d Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Is this not a windows issue?
On Sat, Jan 29, 2011 at 4:33 PM, V=EDt Ondruch = <v.ondruch@gmai= l.com> wrote:
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 &qu= ot;bla".
Because you gave "bla.". =A0Dir.glob respects the given pattern a= s possible.
And "bla." and "bla" are same on NTFS.
Wouldn't that fact imply that "bla.*" should also match "= ;bla" in that
case? =A0I think that is where the confusion lies. =A0Some globs, such as "bla.*", won't match "bla" while others, such as &q= uot;bla.", will match.

I would argue that for compatibility reasons, globbing on "bla." = should
*not* match even on Windows. =A0Globbing 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 wh= ile you can do this on linux:

vita@vita-desktop:~$ echo something > bla
vita@vita-desktop:~$ echo something > bla.
vita@vita-desktop:~$ ls bla*
bla =A0bla.


the windows version will have different result no matter what:


C:\temp>echo something > bla

C:\temp>echo something > bla.

C:\temp>dir bla*

=A0Svazek v jednotce C je Windows7_x64_OS.
=A0S=E9riov=E9 =E8=EDslo svazku je 2C6E-5F69.

=A0V=FDpis adres=E1=F8e C:\temp

29.01.2011 =A017:31 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A012 bla
=A0 =A0 =A0 =A0 =A0 Soubor=F9: =A0 =A0 =A01, =A0 Bajt=F9: =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 12
=A0 =A0 =A0 =A0 =A0 Adres=E1=F8=F9: =A0 =A0 0, =A0 Voln=FDch bajt=F9: 21 4= 59 759 104

C:\temp>dir bla*.*

=A0Svazek v jednotce C je Windows7_x64_OS.
=A0S=E9riov=E9 =E8=EDslo svazku je 2C6E-5F69.

=A0V=FDpis adres=E1=F8e C:\temp

29.01.2011 =A017:31 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A012 bla
=A0 =A0 =A0 =A0 =A0 Soubor=F9: =A0 =A0 =A01, =A0 Bajt=F9: =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 12
=A0 =A0 =A0 =A0 =A0 Adres=E1=F8=F9: =A0 =A0 0, =A0 Voln=FDch bajt=F9: 21 4= 59 759 104







--0016367b664e5dc9ba049afecc9d--