Class Storage#mkdir

storage

Class Summary
Constructor Attributes Constructor Name and Description
 
Storage#mkdir(successCallback, errorCallback, options)

Creates a directory.

Class Detail

Storage#mkdir(successCallback, errorCallback, options)

Creates a directory. The path should be described in URI format. If the URI is for external memory, external storage device should be connected to the external memory port with proper permission. The directory will be created recursively.


function mkdir() {
   var successCb = function (){
     console.log( "directory created successfully"); 
   }; 

   var failureCb = function(cbObject){ 
     var errorCode = cbObject.errorCode;
     var errorText = cbObject.errorText; 
     console.log( " Error Code [" + errorCode + "]: " + errorText); 
   };

   // The directory will be created recursively.
   var mkdirOption = { 
     path: "file://internal/create/this/directory"
   }; 

   var storage = new Storage();
   storage.mkdir(successCb, failureCb, mkdirOption);

}
Parameters:
{Function} successCallback
success callback function.
{Function} errorCallback
failure callback function.
{Object} options
PropertyTypeDescriptionRequired
pathStorage.SCAP_URIURI to the directory to create. required
Since:
1.1
Returns:

After the method is successfully executed, successCallback is called without any parameter.
If an error occurs, errorCallback is called with errorCode and errorText. To see how error codes are defined, check Error.ERROR_CODE