Tech Tip: A utility to convert a Relative path to an Absolute POSIX path
PRODUCT: 4D | VERSION: 12.6 | PLATFORM: Mac & Win
Published On: May 23, 2014
There are many versions of code to get or convert a relative 4D path to an absolute path, but this one is updated to use new v12 commands. In particular, this utility takes advantage of the fact that “Convert path system to POSIX” automatically converts a relative path into absolute.
The command Convert path system to POSIX converts the relative path, expressed as either a Mac or Windows path, into a absolute path in POSIX format.
The command Convert path POSIX to system converts the POSIX path back to a system path, Mac or Windows.
// Description: // Converts a relative path to an absolute path. // // The path is relative to the current structure, of course. // // The path must be in "system" format. C_TEXT($0;$absolutePath_T) C_TEXT($relativePath_T;$1) $relativePath_T=$1 $absolutePath_T=Convert path POSIX to system(Convert path system to POSIX($relativePath_T)) $0:=$absolutePath_T |