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

Jesse Phillips jessekphillips+D at gmail.com
Tue Mar 1 07:35:11 PST 2011


Daniel Gibson Wrote:

> .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 

I don't like this description, it is a configuration file which just so happens to have the convention of not being shown. Linux doesn't have "hidden" files.

But I agree that is the name of the file and not the extension. I'm not sure if it matters how the library actually deals with it. What scares me is calling getName on it would return:

assert("/home/user/.bashrc" == "/home/user/");

How am I supposed to interpret that, it is a directory, what happens when I call getName again?

I think the behavior for getName is different in Linux then in Windows. And in Windows I have added extensions to a file so a could get the file name (use getBaseName or whatever it is called, with getName.)

So I agree with every thing Nick has said.

> 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