About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/mkdir.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 mkdir Context: slangrtl

Synopsis

Create a new directory

Syntax

Integer_Type mkdir (String_Type dir, Integer_Type mode)

Description

The mkdir function creates a directory whose name is specified by the dir parameter with permissions specified by mode. Upon success mkdir returns zero, or it returns -1 and sets errno accordingly. In particular, if the directory already exists, the function will fail and set errno to EEXIST.

Example

     define my_mkdir (dir)
     {
        if (0 == mkdir (dir, 0777)) return;
        if (errno == EEXIST) return;
        verror ("mkdir %s failed: %s", dir, errno_string (errno));
     }

The mode parameter may not be meaningful on all systems. On systems where it is meaningful, the actual permissions on the newly created directory are modified by the process's umask.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.