mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-31 15:43:57 +00:00
1. Updated fs.readdirSync(), so when enumerating windir with a 32 bit agent on 64 bit windows, it will add 'sysnative' to the results
2. Added documentation for sysinfo
This commit is contained in:
@@ -2590,7 +2590,9 @@ void ILibDuktape_fs_PUSH(duk_context *ctx, void *chain)
|
||||
exports.statSync = function statSync(pathstr) { return(this._statSync(this._fixwinpath(pathstr))); };\
|
||||
exports.readdirSync = function readdirSync(pathstr)\
|
||||
{\
|
||||
var sysnative=false;\
|
||||
pathstr = exports._fixwinpath(pathstr);\
|
||||
if(require('os').arch()=='x64' && require('_GenericMarshal').PointerSize==4 && pathstr.split('\\\\*').join('').toLowerCase()==process.env['windir'].toLowerCase()) { sysnative=true; }\
|
||||
if(!pathstr.endsWith('*'))\
|
||||
{\
|
||||
if(pathstr.endsWith('\\\\'))\
|
||||
@@ -2602,7 +2604,9 @@ void ILibDuktape_fs_PUSH(duk_context *ctx, void *chain)
|
||||
pathstr += '\\\\*';\
|
||||
}\
|
||||
}\
|
||||
return(exports._readdirSync(pathstr));\
|
||||
var ret = exports._readdirSync(pathstr);\
|
||||
if(sysnative) { ret.push('sysnative'); }\
|
||||
return(ret);\
|
||||
};\
|
||||
}";
|
||||
ILibDuktape_ModSearch_AddHandler_AlsoIncludeJS(ctx, copyFile, sizeof(copyFile) - 1);
|
||||
|
||||
Reference in New Issue
Block a user