Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - 日本語 - Русский

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

Ajuda do Scilab >> Arquivos : funções de Entrada/Saída > Directory > mkdir

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
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:09:45 CET 2017