FileNameJoin[{"name1","name2",…}]
joins the namei together into a file name suitable for your current operating system.
FileNameJoin[{CloudObject[…],"name2",…}]
joins the namei to the path in the specified cloud object.
FileNameJoin[{LocalObject[…],"name2",…}]
joins the namei to the path in the specified local object.
FileNameJoin["name1","name2", …]
is equivalent to FileNameJoin[{"name1","name2",…}].


FileNameJoin

FileNameJoin[{"name1","name2",…}]
joins the namei together into a file name suitable for your current operating system.
FileNameJoin[{CloudObject[…],"name2",…}]
joins the namei to the path in the specified cloud object.
FileNameJoin[{LocalObject[…],"name2",…}]
joins the namei to the path in the specified local object.
FileNameJoin["name1","name2", …]
is equivalent to FileNameJoin[{"name1","name2",…}].
Details and Options

- The "namei" can be either individual names or file paths containing pathname separators.
- FileNameJoin[{"","name1",…}] gives an absolute file path beginning with a pathname separator.
- FileNameJoin[…,OperatingSystem->"os"] yields a file name in the format for the specified operating system. Possible choices are "Windows", "MacOSX", and "Unix".
- FileNameJoin just assembles a file name; it does not actually search for the file specified.
- FileNameJoin["name"] canonicalizes the file name "name", making pathname separators appropriate for your operating system.
- FileNameJoin[{URL["file:///path"],"name2",…}] joins the namei to the path in the specified file-based URL. »
Examples
open all close allBasic Examples (3)
Scope (3)
Applications (1)
Get the path to a subdirectory of $LocalBase:
Properties & Relations (2)
On Windows, the share name is treated as a single unit:
FileNameJoin is the inverse of FileNameSplit:
Possible Issues (1)
Deploying to a cloud path generated with FileNameJoin will fail if the parent object is not a directory:

See Also
FileNameSplit ExpandFileName StringJoin DirectoryName Get $Input $InputFileName $PathnameSeparator $OperatingSystem
Function Repository: FileNameWithDate
Tech Notes
Related Guides
Related Workflows
- Deploy and Use a Cloud-Based API on the Command Line
History
Introduced in 2008 (7.0) | Updated in 2019 (12.0) ▪ 2020 (12.1) ▪ 2024 (14.1)
Text
Wolfram Research (2008), FileNameJoin, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameJoin.html (updated 2024).
CMS
Wolfram Language. 2008. "FileNameJoin." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/FileNameJoin.html.
APA
Wolfram Language. (2008). FileNameJoin. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileNameJoin.html
BibTeX
@misc{reference.wolfram_2025_filenamejoin, author="Wolfram Research", title="{FileNameJoin}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/FileNameJoin.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_filenamejoin, organization={Wolfram Research}, title={FileNameJoin}, year={2024}, url={https://reference.wolfram.com/language/ref/FileNameJoin.html}, note=[Accessed: 08-August-2025]}