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.

DetailsDetails

  • 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.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Provide operating system dependent file name:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 1996
(3.0)