FileNameJoin
✖
FileNameJoin

joins the namei together into a file name suitable for your current operating system.
joins the namei to the path in the specified cloud object.
joins the namei to the path in the specified local object.
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 allclose allBasic Examples (3)Summary of the most common use cases
Give a system-dependent file name:

https://wolfram.com/xid/0g7fnxy2nua-jglt4a

Append the file name to a path:

https://wolfram.com/xid/0g7fnxy2nua-jzbtxr

Construct a cloud object from a directory cloud object and a file name:

https://wolfram.com/xid/0g7fnxy2nua-eqgldz

Scope (3)Survey of the scope of standard use cases
Append file name to a cloud object:

https://wolfram.com/xid/0g7fnxy2nua-ombbjd


https://wolfram.com/xid/0g7fnxy2nua-cwy7x

Append paths to a local object:

https://wolfram.com/xid/0g7fnxy2nua-yebncj

Append paths to a file-based URL:

https://wolfram.com/xid/0g7fnxy2nua-qya1f8

Applications (1)Sample problems that can be solved with this function
Get the path to a subdirectory of $LocalBase:

https://wolfram.com/xid/0g7fnxy2nua-zbzdg7

Properties & Relations (2)Properties of the function, and connections to other functions
On Windows, the share name is treated as a single unit:

https://wolfram.com/xid/0g7fnxy2nua-psueb7

FileNameJoin is the inverse of FileNameSplit:

https://wolfram.com/xid/0g7fnxy2nua-n8dh2z


https://wolfram.com/xid/0g7fnxy2nua-8gst3t

Possible Issues (1)Common pitfalls and unexpected behavior
Deploying to a cloud path generated with FileNameJoin will fail if the parent object is not a directory:

https://wolfram.com/xid/0g7fnxy2nua-mk8qhr


https://wolfram.com/xid/0g7fnxy2nua-b15p78


Wolfram Research (2008), FileNameJoin, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameJoin.html (updated 2024).
Text
Wolfram Research (2008), FileNameJoin, Wolfram Language function, https://reference.wolfram.com/language/ref/FileNameJoin.html (updated 2024).
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.
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
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: 25-March-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: 25-March-2025
]}