"join paths" -- something I'll make more use of.

My example filename has a .a4d in it. I would never have a .a4d in a
directory name. It would have been safe for my application, but as you
suggest "join paths" is the more correct command.

This all began because I needed a conditional "include". Testing for the
presence of a file to include with one path and including it with another
path sent me down this thread... After testing a variety of options I found
what would work.

Thanks!!
David


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Aparajita
Fishman
Sent: Sunday, May 22, 2011 1:48 AM
To: [email protected]
Subject: Re: [Active4d-dev] file exists but returns false

> $Path_Long:=replace string(current path;current file;$FileName)

Not a good idea. If 'current file' occurs elsewhere in the path, you will
get an invalid result. You should always be doing this:

$path := join paths(directory of(current path); $filename)

To be safe, always use the path commands to manipulate paths, don't treat a
path as a raw string.

_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to