getrelativefilename
given absolute directories and absolute filenames, returns relative file names
Syntax
rel_file = getrelativefilename(abs_dir, abs_file)
Arguments
- abs_dir
a character string or matrix of character strings: absolute directories.
- abs_file
a character string or matrix of character strings: absolute filenames.
- rel_file
a character string or a matrix of character strings: relative filenames.
Description
Given absolute directories abs_dir and absolute filenames abs_file, getrelativefilename returns relative file names rel_file. That is, if the input arguments are some string matrices (m x n), for indexes (i, j), getrelativefilename returns rel_file(i,j) associated with abs_dir(i,j) and abs_file(i,j).
This implies that abs_dir and abs_file must have the same dimensions.
For example, if the current directory is
C:\scilab\bin and the filename
C:\scilab\modules\helptools\readme.txt is
given, getrelativefilename will return
..\modules\helptools\readme.txt.
Examples
getrelativefilename(pwd(), SCI+'/COPYING') getrelativefilename(TMPDIR, SCI+'/COPYING') getrelativefilename(SCI+'/bin', SCI+'/COPYING') getrelativefilename(pwd(), SCI+'/ACKNOWLEDGMENTS') getrelativefilename(TMPDIR, SCI+'/ACKNOWLEDGMENTS') getrelativefilename(SCI+'/bin', SCI+'/ACKNOWLEDGMENTS') getrelativefilename([SCI+'/bin',SCI+'/bin'], [SCI+'/ACKNOWLEDGMENTS',SCI+'/ACKNOWLEDGMENTS'])
See also
- getshortpathname — retourne le chemin au format court (Seulement pour Windows)
- getlongpathname — retourne le chemin au format nom long (Seulement pour Windows)
- pwd — affiche le répertoire courant de Scilab
| Report an issue | ||
| << getlongpathname | Chemins - nom de fichiers | getshortpathname >> |