mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Fix filemanager cp/mv/rm operations not work on Android
This commit is contained in:
2
base
2
base
Submodule base updated: ae6ea7e96c...d2c53757a0
@@ -26,6 +26,10 @@ local FileManager = InputContainer:extend{
|
||||
-- our own size
|
||||
dimen = Geom:new{ w = 400, h = 600 },
|
||||
onExit = function() end,
|
||||
|
||||
mv_bin = Device:isAndroid() and "/system/bin/mv" or "/bin/mv",
|
||||
cp_bin = Device:isAndroid() and "/system/bin/cp" or "/bin/cp",
|
||||
rm_bin = Device:isAndroid() and "/system/bin/rm" or "/bin/rm",
|
||||
}
|
||||
|
||||
function FileManager:init()
|
||||
@@ -265,9 +269,9 @@ function FileManager:pasteHere(file)
|
||||
local dest = lfs.attributes(file, "mode") == "directory" and
|
||||
file or file:match("(.*/)")
|
||||
if self.cutfile then
|
||||
util.execute("/bin/mv", orig, dest)
|
||||
util.execute(self.mv_bin, orig, dest)
|
||||
else
|
||||
util.execute("/bin/cp", "-r", orig, dest)
|
||||
util.execute(self.cp_bin, "-r", orig, dest)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -275,7 +279,7 @@ end
|
||||
function FileManager:deleteFile(file)
|
||||
local InfoMessage = require("ui/widget/infomessage")
|
||||
DEBUG("File to remove", util.realpath(file))
|
||||
local rm = util.execute("/bin/rm", "-rf", util.realpath(file))
|
||||
local rm = util.execute(self.rm_bin, "-rf", util.realpath(file))
|
||||
DEBUG("rm status", rm)
|
||||
if rm == 0 then
|
||||
UIManager:show(InfoMessage:new{
|
||||
|
||||
Reference in New Issue
Block a user