Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.1.0 - Português


mkdir

makes a new directory

Syntax

mkdir(dirname)
mkdir(parentdir, dirname)
status = mkdir( ... )
[status, msg] = mkdir( ... )

Arguments

dirname

a character string: a directory to create.

parentdir

a character string: a directory in which the new directory dirname will be created.

status

an integer: the status of the operation.

msg

a character string: a message about an error.

Description

mkdir(dirname) creates the directory dirname in the current directory, if dirname represents a relative path. Otherwise, dirname represents an absolute path and mkdir attempts to create the absolute directory dirname.

mkdir(parentdir, dirname) creates the directory dirname in the directory parentdir (if parentdir is not existing it will be created), where parentdir is an absolute or relative pathname.

[status,msg] = mkdir(parentdir, dirname) creates the directory dirname in the existing directory parentdir, returning the status and the message about an error.

status msg
-2 mkdir: An error occurred: A file with the same name already exists in dirname
0 mkdir: An error occurred: Impossible to create directory dirname
1
2 mkdir: An error occurred: This directory already exists in dirname

Whatever the operating system, if the creating of directory succeeds, the status is 1 and the message msg is empty.

Examples

// Absolute pathname
mkdir(TMPDIR+"/mkdir_example_1")
status_2 = mkdir(TMPDIR+"/mkdir_example_2")
[status_3,msg_3] = mkdir(TMPDIR+"/mkdir_example_3")

// Absolute pathname (parentdir + dirname)
[status_4,msg_4] = mkdir(TMPDIR,"mkdir_example_4")

// Relative pathname
cd TMPDIR;
[status_5,msg_5] = mkdir("mkdir_example_5")
[status_6,msg_6] = mkdir("mkdir_example_5/mkdir_example_6")

See also

  • chdir — muda o diretório corrente do Scilab
  • dir — gets file list
  • rmdir — removes a directory
Report an issue
<< ls Directory pwd >>

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 Jun 17 17:53:24 CEST 2024