ToFileName

As of Version 7.0, ToFileName has been superseded by FileNameJoin.

ToFileName["directory","name"]

assembles a full file name from a directory name and a file name.

ToFileName[{dir1,dir2,},name]

assembles a full file name from a hierarchy of directory names.

ToFileName[{dir1,dir2,}]

assembles a single directory name from a hierarchy of directory names.

Details

  • ToFileName works differently on different computer systems.
  • ToFileName just creates a file name; it does not actually search for the file specified.
  • ToFileName["","name"] gives "name".
  • ToFileName uses the current setting for $PathnameSeparator to separate elements of the file name.

Examples

Basic Examples  (1)

Provide operating system dependent file name:

Wolfram Research (1996), ToFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/ToFileName.html.

Text

Wolfram Research (1996), ToFileName, Wolfram Language function, https://reference.wolfram.com/language/ref/ToFileName.html.

CMS

Wolfram Language. 1996. "ToFileName." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ToFileName.html.

APA

Wolfram Language. (1996). ToFileName. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ToFileName.html

BibTeX

@misc{reference.wolfram_2024_tofilename, author="Wolfram Research", title="{ToFileName}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ToFileName.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_tofilename, organization={Wolfram Research}, title={ToFileName}, year={1996}, url={https://reference.wolfram.com/language/ref/ToFileName.html}, note=[Accessed: 21-November-2024 ]}