feature(commander) mode: str -> number

This commit is contained in:
coderaiser 2013-12-06 16:34:17 +00:00
parent c32de8b4d0
commit aa84085c6b

View file

@ -112,7 +112,7 @@
* @param pFiles - array of files of current directory
*/
function fillJSON(pParams) {
var name, stat, mode, isDir, size, uid,
var name, stat, mode, isDir, size, uid, modeStr,
p, i, n, file, path, json, files,
ret = Util.checkObjTrue(pParams, ['files', 'stats', 'path']);
@ -136,7 +136,8 @@
if (stat) {
/* Переводим права доступа в 8-ричную систему */
mode = Number(stat.mode).toString(8);
modeStr = Number(stat.mode).toString(8);
mode = Number(modeStr);
isDir = stat.isDirectory();
size = isDir ? 'dir' : stat.size;
}