Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - Русский - 日本語
Scilab Help >> Files : Input/Output functions > Paths - Filenames > fileparts

fileparts

returns the path, filename and extension for a file path

Syntax

[path, fname, extension] = fileparts(fullpath)
value = fileparts(fullpath, sel)

Arguments

fullpath

a string or a string matrix, the given file path.

sel

a optional character string selector, with possible values: 'path', 'fname' or 'extension'.

path

a string or a string matrix, the path of the directory pointed to by fullpath.

fname

a string or a string matrix, the filename part is any or ''.

extension

a string or a string matrix, the extension part is any or ''.

value

a string or a string matrix, depending on sel value.

Description

[path, fname, extension] = fileparts(fullpath) splits the fullpath character string in its three parts: the path of the directory pointed to, the filename part, the extension part including the dot.

Examples

[path,fname,extension]=fileparts('SCI/etc/scilab.start')
fileparts('SCI/etc/scilab.start','extension')
[path,fname,extension]=fileparts(['SCI/etc/scilab.start', 'SCI/etc/scilab.start'])
fileparts(['SCI/etc/scilab.start', 'SCI/etc/scilab.start'],'extension')

See Also

  • pathconvert — converts a path to an OS path format.
  • basename — strip directory and suffix from filenames
  • fullfile — builds a full filename from parts
Scilab Enterprises
Copyright (c) 2011-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:27:38 CEST 2016