make shared object distinguishable from executable files in getFileType and file

This commit is contained in:
Lisa Milne 2023-12-03 16:11:56 +10:00
parent 129c6ff315
commit 0a9e229841
2 changed files with 13 additions and 2 deletions

View file

@ -747,6 +747,9 @@ Options:
case stdio.types.FT_IMAGE:
txt += 'Image';
break;
case stdio.types.FT_LIBRARY:
txt += 'Shared Object';
break;
default:
txt += 'Unknown Data';
break;

View file

@ -1566,6 +1566,7 @@ clite.io = {
// 6: unloaded remote file
// 7: shell script
// 8: image
// 9: shared object (library)
types:{
FT_UNKOWN:0,
FT_TEXT:1,
@ -1575,7 +1576,8 @@ clite.io = {
FT_DEV:5,
FT_REMOTE:6,
FT_SCRIPT:7,
FT_IMAGE:8
FT_IMAGE:8,
FT_LIBRARY:9
},
creat:null,
open:null,
@ -2180,7 +2182,13 @@ clite.lib = {
return clite.io.types.FT_TEXT;
break;
case 'function': // executable
return clite.io.types.FT_BINARY;
if (fd.node.data.content.length == 2) {
return clite.io.types.FT_LIBRARY;
}else if (fd.node.data.content.length == 3) {
return clite.io.types.FT_BINARY;
}else{
return clite.io.types.FT_UNKOWN;
}
break;
case 'object':
if (Array.isArray(fd.node.data.content)) // directory