fileparts: MATLAB fileparts function

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/fileparts.R

Description

Return filename parts.

Usage

1
fileparts(pathname)

Arguments

pathname

character string representing pathname to be parsed

Details

Determines the path, filename, extension, and version for the specified file. The returned ext contains a dot (.) before the file extension. The returned versn is always an empty string as the field is provided for compatibility with its namesake's results.

Value

Returns a list with components:

pathstr

character string representing directory path

name

character string representing base of file name

ext

character string representing file extension

versn

character string representing version. Unused

Note

Returns same insane results as does its namesake when handling relative directories, UNIX hidden files, and tilde expansion. Hidden files are returned with name containing a zero length vector and ext containing the actual name. For best results, use this routine to process files, not directories.

Author(s)

P. Roebuck proebuck@mdanderson.org

See Also

fullfile

Examples

1
2
3
## Rename dot-txt file as dot-csv
ans <- fileparts("/home/luser/foo.txt")
fullfile(ans$pathstr, paste(ans$name, "csv", sep="."))   # /home/luser/foo.csv

matlab documentation built on May 20, 2017, 4:40 a.m.

Search within the matlab package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.