对于GetLRL

时间:2015-06-01 20:45:55

标签: android android-intent

1 个答案:

答案 0 :(得分:1)

GetLRL类必须是一个Activity( // Function to write a file in a non-existing directory function writeFile(path, contents, cb){ mkdirp(getDirName(path), function(err){ if (err) return cb(err); fs.writeFile(path, contents, cb); }); } // Check if log file exists, if it does not, then create it fs.exists(__dirname + '/log/access.log', function(exists){ if(exists){ app.use(logger('common', { stream: fs.createWriteStream(__dirname + '/log/access.log', {flags: 'a'}) })); console.log('access.log exists!'); } else { writeFile(__dirname + '/log/access.log', {flag: 'wx'}, function(err){ if (err) throw err; console.log('access.log created!'); }); } }); ),如果不是,那么将抛出未定义的方法异常