Fill the stats object as much as we can.

This commit is contained in:
Cheng Zhao 2014-09-24 19:10:13 +08:00
parent 0cab034dab
commit 4d2e4ed573

View file

@ -14,8 +14,18 @@ splitPath = (p) ->
return [false, p]
# Convert asar archive's Stats object to fs's Stats object.
nextInode = 0
uid = if process.getuid? then process.getuid() else 0
gid = if process.getgid? then process.getgid() else 0
asarStatsToFsStats = (stats) ->
{
dev: 1,
ino: ++nextInode,
mode: 33188,
nlink: 1,
uid: uid,
gid: gid,
rdev: 0,
size: stats.size
isFile: -> stats.isFile
isDirectory: -> stats.isDirectory