Bug in glob.glob for files w/o extentions in Windows
Georgy Pruss
see_signature__ at hotmail.com
Sun Nov 30 01:18:36 EST 2003
"Jules Dubois" <bogus at invalid.tld> wrote in message news:nj2k03e19clm$.uctj11fclu96$.dlg at 40tude.net...
| On Sun, 30 Nov 2003 03:47:38 GMT, in article
| <news:uLdyb.46389$I53.2118790 at twister.southeast.rr.com>, Georgy Pruss
| wrote:
|
| > On Windows XP glob.glob doesn't work properly for files without extensions.
| > E.g. C:\Temp contains 4 files: 2 with extensions, 2 without.
| > [...]
| > C:\Temp>dir /b *.
| > ccccc
| > ddddd
|
| This is standard Windows behavior. It's compatible with CP/M and therefore
| MS-DOS, and Microsoft has preserved this behavior in all versions of
| Windows.
That's what I meant, wanted and liked.
C'mon guys, I don't care if it's FAT, NTFS, Windows, Linux, VMS or whatever.
All I wanted was to get files w/o dots in their names (on my computer :)).
I did it and I can do it on any system if I need.
| Did you ever poke around in the directory system in a FAT partition
| (without VFAT)? You'll find that every file name is exactly 11 characters
| long and "." is not found in any part of any file name in any directory
| entry.
|
| It's bizarre but that's the way it works. If you try
|
| dir /b *
|
| does cmd.exe list only files without extensions?
By definition it's the same as *.* if my memory serves me right.
| >>>> glob.glob( '*.' )
| > []
| >
|
| glob provides "Unix style pathname pattern expansion" as documented in the
| _Python Library Reference_: If there's a period (".") in the pattern, it
| must match a period in the filename.
|
| > It looks like a bug.
|
| No, it's proper behavior. It's Windows that's (still) screwy.
I see.
Show the world a perfect OS and you'll be a billionaire.
G-:
More information about the Python-list
mailing list