Construct Path to File

DESCRIPTION:

From the given path components and file or directory name, construct the path to a file or directory in a platform-independent way.

USAGE:

file.path(..., fsep=dirSeparator())

REQUIRED ARGUMENTS:

...
character strings containing the path components for creating the path name for a file or directory.

OPTIONAL ARGUMENTS:

fsep
character string containing the path separator to use. The default value is the separator that is correct for the platform of the currently running S-PLUS.

VALUE:

A character string with all the ... arguments concatenated together in the order given and separated by the fsep string.

If no path arguments are supplied, then an empty character vector is returned.

DETAILS:

This function emulates the R function file.path. In addition, the S-PLUS version changes all "\\" or "/" in the path components to the string given by the fsep argument.

SEE ALSO:

, , , , .

EXAMPLES:

# list the contents of the S-PLUS module directory
list.files(file.path(getenv("SHOME"),"module"))

# convert a file path to one appropriate for the platform
# where S-PLUS is currently running
file.path("\\\\dingy\\splus/module/wavelets/wavelets2.pdf")