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

Merge branches 'copycheck' and 'renamefix'

This commit is contained in:
SquidDev
2019-06-13 08:03:35 +01:00
4 changed files with 92 additions and 1 deletions

View File

@@ -15,6 +15,10 @@ if #tFiles > 0 then
elseif #tFiles == 1 then
if fs.exists( sDest ) then
printError( "Destination exists" )
elseif fs.isReadOnly( sDest ) then
printError( "Destination is read-only" )
elseif fs.getFreeSpace( sDest ) < fs.getSize( sFile ) then
printError( "Not enough space" )
else
fs.copy( sFile, sDest )
end

View File

@@ -7,8 +7,15 @@ end
local sSource = shell.resolve( tArgs[1] )
local sDest = shell.resolve( tArgs[2] )
if fs.exists( sDest ) then
if not fs.exists( sSource ) then
printError( "No matching files" )
return
elseif fs.exists( sDest ) then
printError( "Destination exists" )
return
elseif fs.isReadOnly( sDest ) then
printError( "Destination is read-only" )
return
end
fs.move( sSource, sDest )