feature(time) add options

This commit is contained in:
coderaiser 2014-04-07 04:50:17 -04:00
parent 1ef8af92cb
commit e2dbbf9019

View file

@ -13,14 +13,26 @@
fs = require('fs'),
Util = main.util;
object.get = function(filename, callback) {
object.get = function(filename, options, callback) {
var noOptions = Util.isFunction(options);
if (!callback && noOptions)
callback = options;
fs.stat(filename, function(error, stat) {
var time;
var time, timeRet;
if (!error)
time = stat.mtime.getTime();
if (!error) {
time = stat.mtime;
if (options && options.str)
timeRet = time;
else
timeRet = time.getTime();
}
Util.exec(callback, error, time);
Util.exec(callback, error, timeRet);
});
};