From 3dcb08cca3f7c920e478a7e70d4a21391b67439c Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Sat, 16 Apr 2016 21:10:58 -0400 Subject: [PATCH] Replaced checkIfFileExists with supertobi's fix and capitalized GIMP in gimp.po where I missed it. --- contrib/de_DE/LC_MESSAGES/gimp.po | 2 +- contrib/gimp.lua | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/de_DE/LC_MESSAGES/gimp.po b/contrib/de_DE/LC_MESSAGES/gimp.po index 4621455..5c90119 100644 --- a/contrib/de_DE/LC_MESSAGES/gimp.po +++ b/contrib/de_DE/LC_MESSAGES/gimp.po @@ -36,4 +36,4 @@ msgstr "Starten von GIMP" #: gimp.lua:243 msgid "Edit with GIMP" -msgstr "Bearbeiten mit Gimp" +msgstr "Bearbeiten mit GIMP" diff --git a/contrib/gimp.lua b/contrib/gimp.lua index 6a825a0..b66f60f 100644 --- a/contrib/gimp.lua +++ b/contrib/gimp.lua @@ -112,15 +112,15 @@ local function checkIfBinExists(bin) return ret end -local function checkIfFileExists(filepath) - local handle = io.popen("ls "..filepath) - local result = handle:read() +-- Thanks Tobias Jakobs for the idea and the correction +function checkIfFileExists(filepath) + local file = io.open(filepath,"r") local ret - handle:close() - if (result) then + if file ~= nil then + io.close(file) dt.print_error("true checkIfFileExists: "..filepath) ret = true - else + else dt.print_error(filepath.." not found") ret = false end