Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.1 - 日本語

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

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

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

getrelativefilename

絶対ディレクトリおよび絶対ファイル名を指定すると, 相対ファイル名を返す.

呼び出し手順

rel_file = getrelativefilename(abs_dir,abs_file)

パラメータ

abs_dir

文字列 : 絶対ディレクトリ

abs_file

文字列 : 絶対ファイル名

rel_file

文字列 : 相対ファイル名

説明

絶対ディレクトリおよび絶対ファイル名を指定すると, 相対ファイル名を返します.

例えば, カレントのディレクトが C:\scilab\bin の場合,ファイル名 C:\scilab\modules\helptools\readme.txt が指定されると, getrelativefilename は ..\modules\helptools\readme.txt を返します.

if getos() == "Windows" then
  getrelativefilename('C:\program file\scilab-4.0\bin','C:\program file\scilab-4.0\modules\helptools\help.dtd')
  getrelativefilename('C:\program file\scilab-4.0\bin\','C:\program file\scilab-4.0\modules\helptools\help.dtd')
  getrelativefilename(SCI+'\bin',SCI+'\modules\helptools\help.dtd')
  getrelativefilename(WSCI+'\bin',WSCI+'\modules\helptools\help.dtd')
  getrelativefilename(pwd(),WSCI+'\bin\Wscilex')
else
  getrelativefilename('/usr/local/scilab-4.0/bin','/usr/local/scilab-4.0/modules/helptools/help.dtd')
  getrelativefilename('/usr/local/scilab-4.0/bin/','/usr/local/scilab-4.0/modules/helptools/help.dtd')
  getrelativefilename(SCI+'/bin',SCI+'/modules/helptools/help.dtd')
  getrelativefilename(pwd(),SCI+'/bin/scilex')
end

参照

  • getshortpathname — ショートパス名を取得 (Windows専用)
  • getlongpathname — ロングパス名を取得 (Windows専用)
  • pwd — Scilab カレントディレクトリを出力
Report an issue
<< getlongpathname Paths - Filenames getshortpathname >>

Copyright (c) 2022-2023 (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:37:33 CEST 2013