PhantomJS - makeDirectory 方法

此方法创建一个新目录。

语法

其语法如下 −

var fs = require('fs');
fs.makeDirectory(path);

示例

命令 − phantomjs makedirectory.js newfiles

var fs = require('fs'); 
var system = require('system'); 
var path = system.args[1]; 
var md = fs.makeDirectory(path); 

console.log(fs.isDirectory(path)); 
phantom.exit();

上述程序生成以下输出

True

phantomjs_file_system_module_methods.html