Navigation

Operators and Keywords

Function List:

C++ API

: filename = fullfile (dir1, dir2, …, file)
: filenames = fullfile (…, files)

Build complete filename from separate parts.

Joins any number of path components intelligently. The return value is the concatenation of each component with exactly one file separator between each non empty part and at most one leading and/or trailing file separator.

If the last component part is a cell array, returns a cell array of filepaths, one for each element in the last component, e.g.:

fullfile ("/home/username", "data", {"f1.csv", "f2.csv", "f3.csv"})
⇒  /home/username/data/f1.csv
    /home/username/data/f2.csv
    /home/username/data/f3.csv

On Windows systems, while forward slash file separators do work, they are replaced by backslashes; in addition drive letters are stripped of leading file separators to obtain a valid file path.

Note: fullfile does not perform any validation of the resulting full filename.

See also: fileparts, filesep.

Package: octave