Email for std.path submissions
Kramer
Kramer_member at pathlink.com
Fri Feb 24 10:02:30 PST 2006
In article <dtn34m$22sv$1 at digitaldaemon.com>, Miles says...
>
>bobef wrote:
>> version(t_Linux)
>> {
>> (...)
>> writefln("\ngetFullPath tests\n");
>>
>> writefln(getFullPath("\\rabbit/..\\bird"));
>> writefln(getFullPath("\\rabbit\\cat\\..\\bird"));
>> writefln(getFullPath("\\rabbit\\..\\bird"));
>> writefln(getFullPath("rabbit.d"));
>> writefln(getFullPath("rabbit\\..\\.\\bird"));
>> writefln(getFullPath(".\\rabbit\\..\\.\\bird\\..\\"));
>
>It is not correct to remove '..' on Linux. '/a/../b' is not garanteed to
>be '/b', since '/a' could be a symbolic link to somewhere else on the
>filesystem.
>
>--
>Miles < http://www.ubr.inf.br/wiki/Usuário:Miles >
>
>"Using Perl for CGI programming is like using Emacs for text editing."
Python does the same thing with it's normpath function.
http://docs.python.org/lib/module-os.path.html
I know it's not optimal, but I suppose until we can get some functions written
to handle symbolic path expansion, it could just be noted in the docs that a
getFullPath type function at the moment, does not handle symbolic links. Then
at least the user is going in with both eyes open.
Good points though for future improvements.
-Kramer
More information about the Digitalmars-d
mailing list