diff --git a/src/ls.js b/src/ls.js index b1cd30eeb..1d1b41b4d 100644 --- a/src/ls.js +++ b/src/ls.js @@ -60,8 +60,15 @@ function _ls(options, paths) { relName = relName.replace(/\\/g, '/'); } if (options.long) { - stat = stat || fs.lstatSync(abs); - list.push(addLsAttributes(relName, stat)); + try { + stat = stat || fs.lstatSync(abs); + } catch(e) { + stat = { + locked: true + }; + } finally { + list.push(addLsAttributes(relName, stat)); + } } else { // list.push(path.relative(rel || '.', file)); list.push(relName);