diff --git a/Src/Hyperion-bash/bin/ls b/Src/Hyperion-bash/bin/ls index 76e85f3..e6b55fd 100644 --- a/Src/Hyperion-bash/bin/ls +++ b/Src/Hyperion-bash/bin/ls @@ -1,5 +1,5 @@ local fs = require("sys.fs") -local stuff = fs.list("") +local stuff = fs.list(syscall.getcwd()) for i,v in ipairs(stuff) do if fs.isDir(v) then print(v.."/") diff --git a/Src/Hyperion-core/lib/sys/fs b/Src/Hyperion-core/lib/sys/fs index 182d9ef..ba4ebee 100644 --- a/Src/Hyperion-core/lib/sys/fs +++ b/Src/Hyperion-core/lib/sys/fs @@ -138,7 +138,7 @@ function fs.chdir(path) end function fs.isDir(path) - return syscall.isDirectory(path) + return syscall.type(path) == "directory" end return fs \ No newline at end of file diff --git a/Src/Hyperion-kernel/lib/modules/Hyperion/10_vfs.kmod b/Src/Hyperion-kernel/lib/modules/Hyperion/10_vfs.kmod index e321de5..6c6e6f1 100644 --- a/Src/Hyperion-kernel/lib/modules/Hyperion/10_vfs.kmod +++ b/Src/Hyperion-kernel/lib/modules/Hyperion/10_vfs.kmod @@ -18,7 +18,7 @@ local function normalizePath(path) table.insert(parts, part) end end - return "/" .. table.concat(parts, "/") .. (path:sub(-1) == "/" and "/" or "") + return "/" .. table.concat(parts, "/") end -- Resolve mount and disk path @@ -142,6 +142,9 @@ local function getFileMeta(path) if parent ~= "/" then parent = parent .. "/" end local target = parts[i] + if target == ".meta" then + error("Cannot open metafile") + end local metaPath = parent .. ".meta" if disk:fileExists(metaPath) then @@ -526,5 +529,7 @@ sys["exists"] = vfs.exists sys["type"] = vfs.type sys["mount"] = vfs.mount sys["umount"] = vfs.umount +sys["getcwd"] = vfs.getcwd +sys["chdir"] = vfs.chdir kernel.log("VFS module loaded") \ No newline at end of file