1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-18 06:05:12 +00:00

Improvements to the various file system programs (rm, mv, rename) (#440)

This enforces several sanity checks before actually attempting
the move, allowing us to produce friendlier error messages.
This commit is contained in:
Lupus590
2020-05-12 11:32:48 +01:00
committed by GitHub
parent 9a71dc1a26
commit 05d7be0362
9 changed files with 145 additions and 8 deletions

View File

@@ -797,6 +797,12 @@ function fs.complete(sPath, sLocation, bIncludeFiles, bIncludeDirs)
return tEmpty
end
function fs.isDriveRoot(sPath)
expect(1, sPath, "string")
-- Force the root directory to be a mount.
return fs.getDir(sPath) == ".." or fs.getDrive(sPath) ~= fs.getDrive(fs.getDir(sPath))
end
-- Load APIs
local bAPIError = false
local tApis = fs.list("rom/apis")