spaces at ends of filenames or directory names on Win32

Larry Bates larry.bates at websafe.com
Sat Feb 25 16:48:20 EST 2006


Jeffrey Schwab wrote:
> Larry Bates wrote:
> 
>> IMHO leading and/or trailing spaces in filenames is asking for
>> incompatibilities with cross-platform file access.
> 
> With what platforms specifically?
> 
>> Much like
>> using single-quote in filenames which are perfectly legal in
>> DOS/Windows, but Linux doesn't like much.
> 
> Uh...  What Linux are you using?  And what FS?
> 
> $ touch "'" && ls
> '
> $ rm "'"
> $

I stand corrected if you put double quotes around filenames
it does work.  That to me means that single quotes
in filenames are somehow "different" than other characters.
You must handle these filenames differently (at least from
the command line).  Thanks for pointing this out.

-Larry Bates




More information about the Python-list mailing list