Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Files : Input/Output functions > Paths - Filenames > fileparts

fileparts

returns the path, filename and extension for a file path

Calling Sequence

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

Arguments

fullpath

a character string, the given file path.

sel

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

path

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

fname

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

extension

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

value

a character string, 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')

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
Report an issue
<< fileext Paths - Filenames filesep >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Apr 02 17:36:22 CEST 2013