mirror of
https://github.com/electron/electron.git
synced 2026-01-23 06:18:17 -05:00
Optimize fs.stat
This commit is contained in:
@@ -29,6 +29,7 @@ splitPath = (p) ->
|
||||
nextInode = 0
|
||||
uid = if process.getuid? then process.getuid() else 0
|
||||
gid = if process.getgid? then process.getgid() else 0
|
||||
fakeTime = new Date()
|
||||
asarStatsToFsStats = (stats) ->
|
||||
{
|
||||
dev: 1,
|
||||
@@ -38,10 +39,10 @@ asarStatsToFsStats = (stats) ->
|
||||
uid: uid,
|
||||
gid: gid,
|
||||
rdev: 0,
|
||||
atime: stats.atime || new Date(),
|
||||
birthtime: stats.birthtime || new Date(),
|
||||
mtime: stats.mtime || new Date(),
|
||||
ctime: stats.ctime || new Date(),
|
||||
atime: stats.atime || fakeTime,
|
||||
birthtime: stats.birthtime || fakeTime,
|
||||
mtime: stats.mtime || fakeTime,
|
||||
ctime: stats.ctime || fakeTime,
|
||||
size: stats.size,
|
||||
isFile: -> stats.isFile
|
||||
isDirectory: -> stats.isDirectory
|
||||
|
||||
Reference in New Issue
Block a user