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


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
Report an issue
<< Directory Directory createdir >>

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:
Thu Oct 24 11:13:09 CEST 2024