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

Lars T. Kyllingstad public at kyllingen.NOSPAMnet
Tue Mar 1 07:08:14 PST 2011


On Tue, 01 Mar 2011 09:52:50 -0500, Steven Schveighoffer wrote:

> On Tue, 01 Mar 2011 09:31:18 -0500, Lars T. Kyllingstad
> <public at kyllingen.nospamnet> wrote:
> 
>> On Tue, 01 Mar 2011 08:50:29 -0500, Nick Sabalausky wrote:
>>
>>> "Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message
> 
>>>> From this page: http://en.wikipedia.org/wiki/Filename, it appears
>>>> that really, the only disallowed character in unix filenames is '/'. 
>>>> Even '*' is allowed as a filename.  How... horrible.
>>> I would actually feel very good to just simply not support such
>>> things. If some unix user is going to use such awful filenames they
>>> can just deal with the consequences. (And I'm *rarely* the kind of
>>> person to hold such a viewpoint on software development matters.)
>>
>> If you have a bunch of "reserved characters", that means more special
>> cases to worry about in code.  I say it's better to allow as many
>> characters as possible.
> 
> You still have to worry about them, because the shell treats them
> specially.
> 
> If there is a file named '*.d', and you type in rm *.d on the command
> line, guess what happens?

If you are using a command line shell you ought to know better than 
typing "rm *.d". :)  If you are using a GUI shell, you right-click and 
select "Delete file", and nothing bad happens.

-Lars


More information about the Digitalmars-d mailing list