From 8f6a236eb65bcdf62da7aaca647fbd0eac68e831 Mon Sep 17 00:00:00 2001 From: Bill Ferguson Date: Thu, 21 Feb 2019 23:49:52 -0500 Subject: [PATCH] Updated files --- contrib/video_ffmpeg.lua | 5 +++-- lib/dtutils/file.lua | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/contrib/video_ffmpeg.lua b/contrib/video_ffmpeg.lua index ffcf1ca..7c7f0bd 100644 --- a/contrib/video_ffmpeg.lua +++ b/contrib/video_ffmpeg.lua @@ -34,11 +34,12 @@ This script has been tested under Linux only ]] local dt = require "darktable" +local du = require "lib/dtutils" local df = require "lib/dtutils.file" local dsys = require "lib/dtutils.system" local gettext = dt.gettext -dt.configuration.check_version(...,{5,0,0}) +du.check_min_api_version("5.0.0") local MODULE_NAME = "video_ffmpeg" @@ -444,7 +445,7 @@ local function finalize_export(storage, images_table, extra_data) end end - df.rm(tmp_dir) + df.rmdir(tmp_dir) end dt.register_storage( diff --git a/lib/dtutils/file.lua b/lib/dtutils/file.lua index cff780b..6b5c5c8 100644 --- a/lib/dtutils/file.lua +++ b/lib/dtutils/file.lua @@ -582,15 +582,15 @@ function dtutils_file.mkdir(path) end end -dtutils_file.libdoc.functions["rm"] = { +dtutils_file.libdoc.functions["rmdir"] = { Name = [[rm]], - Synopsis = [[remove file or directory]], + Synopsis = [[recursively remove a directory]], Usage = [[local df = require "lib/dtutils.file" - df.rm(path) - path - string - a file or directory path]], - Description = [[rm allow to recursively remove files or directories]], - Return_Value = [[path - string - a file or directory path]], + df.rmdir(path) + path - string - a directory path]], + Description = [[rmdir recursively removes directories and any files contained within]], + Return_Value = [[path - string - a directory path]], Limitations = [[]], Example = [[]], See_Also = [[]], @@ -598,9 +598,9 @@ dtutils_file.libdoc.functions["rm"] = { License = [[]], Copyright = [[]], } -function dtutils_file.rm(path) - local rm_cmd = dt.configuration.running_os == "windows" and "rmdir /S /Q" or "rm -r" - return dsys.external_command(rm_cmd.." "..dtutils_file.sanitize_filename(path)) +function dtutils_file.rmdir(path) + local rmdir_cmd = dt.configuration.running_os == "windows" and "rmdir /S /Q" or "rm -r" + return dsys.external_command(rmdir_cmd.." "..dtutils_file.sanitize_filename(path)) end