converts a path to an OS path format.
paths = pathconvert(paths) paths = pathconvert(paths, flagtrail) paths = pathconvert(paths, flagtrail, flagexpand) paths = pathconvert(paths, flagtrail, flagexpand, type)
a string matrix giving a set of file paths
optional boolean, used to add a trailing file separator to the
paths (\
or /
,
depending on the target path format). Default value is true
(%t
).
optional boolean, used to expand leading variables in paths.
Default value is true (%t
).
optional string, used to specify the target path format: 'u'
for POSIX path format (GNU/Linux,...), and 'w'
for
Windows path format.
pathconvert
is used to convert a set of paths,
to be compatible with an OS (Operating System) path format.
For example Windows path style uses /
for file separator,
while it is \
on other OS.
By default, the paths are converted to the current OS path format (but another path
format can be specified with argument type
).
![]() | When some Windows-like paths starting with a drive letter like "C:" are converted
to a non-Windows format, the drive letter is then converted using the
cygwin convention, with the /cygdrive/ header.
For example, C:\tmp will be converted to /cygdrive/C/tmp . |
flagtrail
is used to add or remove a file
separator (depending on the target path format) to the end
of paths. When the parameter is set to true, a trailing file
separator is added if missing. Otherwise, the trailing file
separators are removed.
flagexpand
is used to expand the leading
Scilab environment variables in paths. The following
variables are accepted:
SCI
WSCI
SCIHOME
TMPDIR
home
(or ~
)![]() | WSCI is unknown on GNU/Linux and
~ in term "path" is unknown on Windows. |
Version | Description |
5.2.0 | flagtrail=%f now removes existing trailing "/" or "\" separators. |