文件操作 - touch.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/atom/resources/app/apm/node_modules/touch/bin/touch.js
编辑文件内容
var touch = require("../touch") , fs = require("fs") , path = require("path") , nopt = require("nopt") , types = { atime: Boolean , mtime: Boolean , time: Date , ref: path , nocreate: Boolean , force: Boolean } , shorthands = { a: "--atime" , m: "--mtime" , r: "--ref" , t: "--time" , c: "--nocreate" , f: "--force" } var options = nopt(types, shorthands) var files = options.argv.remain delete options.argv files.forEach(function (file) { touch(file, options, function (er) { if (er) { console.error("bad touch!") throw er } console.error(file, fs.statSync(file)) }) })
修改文件时间
将文件时间修改为当前时间的前一年
删除文件