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

Jim bitcirkel at yahoo.com
Tue Mar 1 02:56:45 PST 2011


Nick Sabalausky Wrote:

> "Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message 
> news:mailman.2076.1298971012.4748.digitalmars-d at puremagic.com...
> >
> > I think that I agree with you on all counts. I can understand if the path 
> > stuff
> > can't deal with / or \ in file names (that's probably not worth trying to 
> > get to
> > work right), but it _should_ be able to handle directories with dots in 
> > them and
> > files with no extension. Files without extension may be uncommon in 
> > Windows, but
> > they're common enough on Linux.
> >
> 
> Due to the practical need for dealing with Unixy systems (for instance, an 
> external web server) and cross-OS compatibility, etc, I deal with 
> extension-less files (and filenames that start with a dot) quite frequently 
> even on Windows, and even though I'm primarily a Windows user.
> 
> That reminds me of something I've often wondered, though: Does unix consider 
> a file named ".bashrc" to be a nameless file with an extension of "bashrc", 
> or just an extentionless file named ".bashrc"? (I know unix doesn't 
> typically have a concept of file extension, it's all just part of the name, 
> but unix programs will often care about the extension portion of a 
> filename.)
> 
> 


No, a filename that begins with a dot is just meant to be "invisible", but the dot is in all respects a part of the name.

The whole idea of _not_ showing the extensions was probably conjured up in the Usability department at Microsoft? I don't remember if they were mandatory in DOS.

In Unix extensions has simply been regarded as part of the name without a fuss. With modern GUIs it seems that this has shifted. But the invisibility dot should not be confused with the extension dot.


More information about the Digitalmars-d mailing list