- 檔案系統模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 系統模組
- PhantomJS - 屬性
- Web 伺服器模組
- PhantomJS - 屬性
- PhantomJS - 方法
- 其他
- 命令列介面
- PhantomJS - 截圖
- PhantomJS - 網頁自動化
- PhantomJS - 網路監控
- PhantomJS - 測試
- PhantomJS - REPL
- PhantomJS - 示例
- PhantomJS 實用資源
- PhantomJS - 快速指南
- PhantomJS - 實用資源
- PhantomJS - 討論
PhantomJS - 觸屏
此方法建立空檔案。
語法
其語法如下所示 -
var fs = require('fs');
fs.touch(path);
示例
以下示例顯示了 touch 方法的工作原理。
命令 - phantomjs touch.js hello.txt
var fs = require('fs');
var system = require('system');
var path = system.args[1];
var md = fs.touch(path);
console.log("file is present : "+fs.isFile(path));
phantom.exit();
結果:以下 輸出。
file is present : true
phantomjs_file_system_module_methods.htm
廣告