www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: std.path.getName(): Screwy by design?

reply Kagamin <spam here.lot> writes:
Nick Sabalausky Wrote:

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

.Net treats it as a nameless file with extension.
Mar 01 2011
next sibling parent reply Daniel Gibson <metalcaedes gmail.com> writes:
Am 01.03.2011 16:38, schrieb Kagamin:
 Nick Sabalausky Wrote:

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

.Net treats it as a nameless file with extension.

.Net is designed for windows, obviously. The right thing to do is to treat a dot at the beginning differently and in all other cases define everything behind the last dot as the extension. Cheers, - Daniel
Mar 01 2011
parent "Nick Sabalausky" <a a.a> writes:
"Daniel Gibson" <metalcaedes gmail.com> wrote in message 
news:ikj45k$mbh$3 digitalmars.com...
 Am 01.03.2011 16:38, schrieb Kagamin:
 Nick Sabalausky Wrote:

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

.Net treats it as a nameless file with extension.

.Net is designed for windows, obviously. The right thing to do is to treat a dot at the beginning differently and in all other cases define everything behind the last dot as the extension.

Yea, the only time you ever have a "nameless file with an extension" on windows is if it's a file that just happens to *be* either ".htaccess" or ".svn" or something else that's already using it in the unix sense (...or if OPTLINK errors out...but I'm not sure that's worth counting ;) ). So I don't think it makes any sense to have the windows build of an app handle the "name vs extension" semantics any differently then it would handle it on unix.
Mar 01 2011
prev sibling parent =?UTF-8?B?IkrDqXLDtG1lIE0uIEJlcmdlciI=?= <jeberger free.fr> writes:
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Kagamin wrote:
 Nick Sabalausky Wrote:
=20
 or just an extentionless file named ".bashrc"? (I know unix doesn't=20
 typically have a concept of file extension, it's all just part of the =


 but unix programs will often care about the extension portion of a=20
 filename.)

.Net treats it as a nameless file with extension.

Python treats it as a file named =E2=80=9C.bashrc=E2=80=9D with no exten= sion. Jerome --=20 mailto:jeberger free.fr http://jeberger.free.fr Jabber: jeberger jabber.fr
Mar 01 2011