Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

dirCreate

dirCreate

Creates a new directory.

Method of

File object

Syntax

int dirCreate( FileSpecObject dirToCreate );

Parameters

The dirCreate method has the following parameters:

 

dirToCreate

 

A FileSpecObject representing the pathname of the directory to create.

Returns

An integer error code. For a list of possible values, see Return Codes.

Description

The input parameter is a FileSpecObject that you have already created with the Install object's getFolder method. The following simple example demonstrates the use of the dirCreate method. Note that the getFolder method does not require that the folder or directory you specify exist in order for the object reference to be a valid one.

Example

f = getFolder("Program", "myNewDirectory");
err = File.dirCreate(f);

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Fredchat, Rod Whiteley
 Last updated by: Sheppy,