split file path into components
join components into file path
string; file path, relative or absolute
list of strings; components of a file path, relative or absolute
options as described below
platform = one of "unix", "windows", or auto.
The platform option specifies the operating system conventions to use when splitting or joining paths. The default value, auto, uses the conventions of the current system.
base = one of bindir, datadir, homedir, mapledir, tempdir, toolboxdir, worksheetdir.
The base option specifies a base directory. The parameter components will be interpreted as a relative path under this directory. For the meaning of each of these symbols, see kernelopts or interface. This option is only supported for JoinPath.
The SplitPath command splits a file path into a list of its path components. The JoinPath(components) command joins a list of path components into a file path appropriate for the host operating system.
SplitPath("SomeDir/SomeFile") returns ["SomeDir", "SomeFile"] and JoinPath(["SomeDir", "SomeFile"]) returns either "SomeDir/SomeFile" (on MacOS and UNIX) or "SomeDir\SomeFile" (on Windows).
On Windows, SplitPath(filepath) handles paths corresponding to file shares specially, keeping the server and share name together. For example, SplitPath("\\SERVER\Share\SomeDir") returns ["\\SERVER\Share", "Somedir"].
SplitPath interprets either a slash (/) or backslash (\) character as a delimiter. JoinPath(components) joins its components together using a delimiter specific to the host operating system.
Neither command checks that the input corresponds to an existing file on disk or performs any disk input/output.
FileTools:-SplitPath( "C:\\Program Files\\Microsoft Office" );
C:,Program Files,Microsoft Office
FileTools:-JoinPath( ["C:", "Program Files", "Microsoft Office"], platform = "windows" );
C:\Program Files\Microsoft Office
FileTools:-JoinPath( ["DirectoryA", "Subdirectory", "MyFile.txt"] );
The FileTools[SplitPath] and FileTools[JoinPath] commands were introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
Download Help Document
What kind of issue would you like to report? (Optional)