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 > Directory > chdir

chdir

changes Scilab current directory

cd

changes Scilab current directory

Syntax

b = chdir(path)
realpath = cd(path)
cd path

Arguments

path

a character string

. The default path is home.
b

a boolean: %t if chdir operation is successful.

realpath

a character string, the real path name after pathname conversion (see below)

Description

Change the current Scilab directory to those given by path.

Note that, if any, SCI, SCIHOME, TMPDIR and home headings constants in path are converted. For example, SCI/modules/core/macros is a valid pattern for both Unix and Windows.

Examples

chdir("SCI/etc")
pwd
cd ..
cd TMPDIR
p = cd()
p == home
--> chdir("SCI/etc")
 ans  =
  T

--> pwd
 ans  =
 C:\Programs\scilab\scilab-6.0.2\etc


--> cd ..
 ans  =
 C:\Programs\scilab\scilab-6.0.2

--> cd TMPDIR
 ans  =
 C:\Users\Me\AppData\Local\Temp\SCI_TMP_5444_26901

--> p = cd()
 p  =
 C:\Users\Me

--> p == home
 ans  =
  T

See also

  • isdir — checks that a path points to an existing directory
  • pwd — gets Scilab current directory
  • home — Gives the user directory.
  • filebrowser — Open the Scilab file browser
  • uigetdir — dialog for selecting a directory
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:20 CET 2020