MmaTranslator[Mma]
DirectoryName
return the directory name from a file path
Calling Sequence
Parameters
Description
Examples
Compatibility
DirectoryName(file path)
file path
-
string specifying the path to a file
The DirectoryName command returns a string that gives the directory name from a file path.
with⁡MmaTranslatorMma:
Use the command with the Maple translation.
DirectoryName⁡/home/UserName/file.ext
/home/UserName/
DirectoryName⁡C:\\Users\\MapleUser\\file.ext
C:\Users\MapleUser\
Alternatively, you can use the FromMma command with the evaluate option specified.
with⁡MmaTranslator:
FromMma⁡`DirectoryName[ "C:\Users\MapleUser\file.ext" ]`,evaluate
The MmaTranslator[Mma][DirectoryName] command was updated in Maple 2017.
See Also
FileTools[ParentDirectory
MmaTranslator
MmaTranslator[FromMma]
Download Help Document