std.path.getName(): Screwy by design?

Daniel Gibson metalcaedes at gmail.com
Tue Mar 1 14:56:47 PST 2011


Am 01.03.2011 23:45, schrieb Nick Sabalausky:
> "Daniel Gibson" <metalcaedes at gmail.com> wrote in message 
> news:ikjqaf$2e9r$2 at digitalmars.com...
>> Am 01.03.2011 22:42, schrieb Nick Sabalausky:
>>>
>>> There's a long, seemingly-unending history of unix programs choking on 
>>> paths
>>> with spaces in them *even* when you give them the paths properly escaped.
>>> Not all unix apps, but enough. I suppose maybe my experience or memory on
>>> this is skewed, but I can't remember that ever happening to me on windows
>>> except for apps that were ported from unix. Maybe things have changed 
>>> within
>>> the last few years, but try taking the source tree for some large unix
>>> program, sticking it in a directory that has a space in the name, and
>>> compiling it from there. I've had problems with that.
>>>
>>> I think the main source of trouble is apps failing to properly escape 
>>> spaces
>>> when they, for instance, generate a script that acts on specific files or
>>> when they send the filenames to another app via the commandline.
>>>
>>>
>>
>> This is a problem of *programs* not dealing properly with spaces in
>> dir/file-names, but not of Unix itself.
>> I guess Windows developers just take more care of these issues than Unix
>> developers did, because spaces in file/dir-names are much more common in 
>> the
>> windows world.
>>
> 
> Unix is nothing more than a kernel + programs anyway (or at least Linux). 
> But at this point I think we're just splitting semantic hairs.
> 

Yeah. My point was that it's not because of shortcomings of APIs in Unix (that
winapi handles better or something), but it's just because Unix coders aren't
(or at least weren't) as aware of possible problems with spaces.
Your original statement was "Windows also handles files/paths with spaces a hell
of a lot better than Unix." so I thought you were talking about the OS (or APIs
that are very close to the OS) and not about applications :-)

Cheers,
- Daniel


More information about the Digitalmars-d mailing list