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

Daniel Gibson metalcaedes at gmail.com
Tue Mar 1 02:47:46 PST 2011


Am 01.03.2011 10:31, schrieb Nick Sabalausky:
> "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.)
>
>

.bashrc doesn't have an extension and is not an extionsion either.
The "." at the start is Unix convention to say "this is a hidden 
file/folder", this means "ls" (the unix equivalent to "dir") doesn't 
list them (ls -a does, though) and most file browsers only list them 
when you select something like "show hidden files" or "show dot files".

Cheers,
- Daniel


More information about the Digitalmars-d mailing list