pathname -- create a platform
dependent path name
Introductionpathname(dir, subdir...) returns a
relative path name valid on the used operating system.
Call(s)pathname(dir, subdir, ..)
pathname(Root, dir, subdir, ..)
Parametersdir, subdir, .. |
- | names of directories: character strings |
OptionsRoot |
- | makes pathname generate an absolute path
name |
Returnsa string.
Related
Functionsfclose, finput, fopen, fprint, fread, ftextinput, LIBPATH, loadproc, package, print, protocol, read, READPATH, write, WRITEPATH
Detailspathname is used to specify pathnames via MuPAD
strings. Directories and subdirectories are concatenated in a suitable
way creating a valid pathname for the currently used operating system.
For example, this mechanism may be used to specify the location of
library files independent of the platform./'' ,
``\'' or ``:''. Compliance with these
conventions is tested by pathname.pathname does not allow to specify a
volume to become part of the path name. Names are always relative to
the current volume.| call | result | platform |
pathname("lib", "linalg") |
"lib/linalg/" |
UNIX/Linux |
"lib\\linalg\\" |
Windows | |
":lib:linalg:" |
MacOS | |
pathname(Root, "lib", "linalg") |
"/lib/linalg/" |
UNIX/Linux |
"\\lib\\linalg\\" |
Windows | |
"lib:linalg:" |
MacOS | |
Example
1The following examples are created on a UNIX/Linux system:
>> pathname("lib", "linalg")
"lib/linalg/"
>> pathname(Root, "lib", "linalg") . "det.mu"
"/lib/linalg/det.mu"