Recoded fileMove to use os.execute and the system mv command. Removed fileCopy as it was no longer needed.
This commit is contained in:
@@ -26,18 +26,18 @@ msgstr ""
|
|||||||
msgid "Export Image %i/%i"
|
msgid "Export Image %i/%i"
|
||||||
msgstr "Exportiere Bild %i/%i"
|
msgstr "Exportiere Bild %i/%i"
|
||||||
|
|
||||||
#: gimp.lua:221
|
#: gimp.lua:202
|
||||||
msgid "Unable to move edited file into collection. Leaving it as %s"
|
msgid "Unable to move edited file into collection. Leaving it as %s"
|
||||||
msgstr "Die bearbeitete Datei kann nicht in die Sammlung aufgenommen werden. Bearbeitet Datei ist %s"
|
msgstr "Die bearbeitete Datei kann nicht in die Sammlung aufgenommen werden. Bearbeitet Datei ist %s"
|
||||||
|
|
||||||
#: gimp.lua:228
|
#: gimp.lua:209
|
||||||
msgid "GIMP not found"
|
msgid "GIMP not found"
|
||||||
msgstr "GIMP nicht gefunden"
|
msgstr "GIMP nicht gefunden"
|
||||||
|
|
||||||
#: gimp.lua:243
|
#: gimp.lua:224
|
||||||
msgid "Launching GIMP..."
|
msgid "Launching GIMP..."
|
||||||
msgstr "Starten von GIMP"
|
msgstr "Starten von GIMP"
|
||||||
|
|
||||||
#: gimp.lua:290
|
#: gimp.lua:271
|
||||||
msgid "Edit with GIMP"
|
msgid "Edit with GIMP"
|
||||||
msgstr "Bearbeiten mit GIMP"
|
msgstr "Bearbeiten mit GIMP"
|
||||||
|
|||||||
@@ -194,34 +194,10 @@ local function show_status(storage, image, format, filename,
|
|||||||
dt.print(string.format(_("Export Image %i/%i"), number, total))
|
dt.print(string.format(_("Export Image %i/%i"), number, total))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function fileCopy(fromFile, toFile)
|
|
||||||
local result = nil
|
|
||||||
local fileIn, err = io.open(fromFile, 'rb')
|
|
||||||
if fileIn then
|
|
||||||
local fileOut, errr = io.open(toFile, 'w')
|
|
||||||
if fileOut then
|
|
||||||
local content = fileIn:read(4096)
|
|
||||||
while content do
|
|
||||||
fileOut:write(content)
|
|
||||||
content = fileIn:read(4096)
|
|
||||||
end
|
|
||||||
result = true
|
|
||||||
fileIn:close()
|
|
||||||
fileOut:close()
|
|
||||||
else
|
|
||||||
dt.print_error("fileCopy Error: " .. errr)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
dt.print_error("fileCopy Error: " .. err)
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
local function fileMove(fromFile, toFile)
|
local function fileMove(fromFile, toFile)
|
||||||
local result = fileCopy(fromFile, toFile)
|
local result = os.execute("mv '" .. fromFile .. "' '" .. toFile .. "'")
|
||||||
if result then
|
dt.print_error("result is " .. tostring(result))
|
||||||
os.remove(fromFile)
|
if not result then
|
||||||
else
|
|
||||||
dt.print_error("fileMove Error: Unable to copy " .. fromFile .. " to " .. toFile .. ". Leaving " .. fromFile .. " in place.")
|
dt.print_error("fileMove Error: Unable to copy " .. fromFile .. " to " .. toFile .. ". Leaving " .. fromFile .. " in place.")
|
||||||
dt.print(string.format(_("Unable to move edited file into collection. Leaving it as %s"), fromFile))
|
dt.print(string.format(_("Unable to move edited file into collection. Leaving it as %s"), fromFile))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user