From 0a9e2298411850676c3684038b863d0498f152b8 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Sun, 3 Dec 2023 16:11:56 +1000 Subject: [PATCH] make shared object distinguishable from executable files in getFileType and file --- clite/commands.js | 3 +++ clite/core.js | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clite/commands.js b/clite/commands.js index 507c736..1e1de00 100644 --- a/clite/commands.js +++ b/clite/commands.js @@ -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; diff --git a/clite/core.js b/clite/core.js index 87271fe..57e920a 100644 --- a/clite/core.js +++ b/clite/core.js @@ -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