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

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

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

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
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:
Mon Jan 03 14:23:28 CET 2022