static File EAROpenArchive(const char * archive, EARHeader header)
{
File f = null;
+ char moduleName[MAX_LOCATION];
+ moduleName[0] = '\0';
if(archive[0] == ':')
{
- char moduleName[MAX_LOCATION];
const char * name = archive + 1;
#if defined(__ANDROID__) || defined(__EMSCRIPTEN__)
+ PrintLn("************************************************************", " archive: ", archive);
if(!name[0])
name = ((SubModule)__thisModule.application.modules.first).next.module.name;
#endif
#if defined(__EMSCRIPTEN__)
- //sprintf(moduleName, "__%s.ear", name);
+ //sprintf(moduleName, "%s.data", name);
sprintf(moduleName, "__%s.ear", "HelloForm");
f = FileOpen(moduleName, read);
+ PrintLn("************************************************************", f == null ? " ERROR: " : " we have moduleName: ", moduleName, " | ", name);
#else
if(LocateModule(name, moduleName))
f = FileOpen(moduleName, read);
// First attempt to treat this as an archive file
if(f.Read(header, sizeof(EARHeader), 1) == 1 &&
!memcmp(header.recognition, earRecognition, sizeof(earRecognition)))
+ {
+#if defined(__EMSCRIPTEN__)
+ PrintLn("************************************************************", " confirm archive moduleName: ", moduleName);
+#endif
return f;
+ }
// Then try to see if an archive is at the end of the file
f.Seek(-(int)sizeof(uint), end);
!memcmp(header.recognition, earRecognition, sizeof(earRecognition)))
return f;
+#if defined(__EMSCRIPTEN__)
+ PrintLn("************************************************************", " ERROR ARCHIVE moduleName: ", moduleName);
+#endif
delete f;
}
return null;