spaces at ends of filenames or directory names on Win32

Jeffrey Schwab jeff at schwabcenter.com
Sat Feb 25 19:11:17 EST 2006


Larry Bates wrote:
> 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.

Sure, no problem.  FYI, the quotes are to keep my shell, which happens 
to be bash, from trying to interpret the quote.  If I were renaming a 
file by clicking the icon in a Windows-like GUI, or using a file 
manager, there would be no need for the quote.



More information about the Python-list mailing list