Fixed compatibility issues. Added new version check to scripts. Renamed lib/dtutils/file/rm() to lib/dtutils/file/rmdir since removing a file in windows with rmdir /q/s results in an error. Fixed os.tmpname() issued in enfuse. Under windows os.tmpname() doesn't put the file in a temporary directory, so fixed it to use darktable.configuration.tmp_dir. Cleaned up documentation in lib/dtutils/system.lua.
This commit is contained in:
@@ -582,14 +582,14 @@ function dtutils_file.mkdir(path)
|
||||
end
|
||||
end
|
||||
|
||||
dtutils_file.libdoc.functions["rmdir"] = {
|
||||
Name = [[rm]],
|
||||
dtutils_file.libdoc.functions["rm"] = {
|
||||
Name = [[rmdir]],
|
||||
Synopsis = [[recursively remove a directory]],
|
||||
Usage = [[local df = require "lib/dtutils.file"
|
||||
|
||||
df.rmdir(path)
|
||||
path - string - a directory path]],
|
||||
Description = [[rmdir recursively removes directories and any files contained within]],
|
||||
Description = [[rm allow to recursively remove directories]],
|
||||
Return_Value = [[path - string - a directory path]],
|
||||
Limitations = [[]],
|
||||
Example = [[]],
|
||||
@@ -598,9 +598,10 @@ dtutils_file.libdoc.functions["rmdir"] = {
|
||||
License = [[]],
|
||||
Copyright = [[]],
|
||||
}
|
||||
|
||||
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))
|
||||
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))
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -104,15 +104,14 @@ end
|
||||
|
||||
dtutils_system.libdoc.functions["launch_default_app"] = {
|
||||
Name = [[launch_default_app]],
|
||||
Synopsis = [[try to open file in default application]],
|
||||
Synopsis = [[open file in default application]],
|
||||
Usage = [[local dsys = require "lib/dtutils.file"
|
||||
|
||||
dsys.launch_default_app(path)
|
||||
result = dsys.launch_default_app(path)
|
||||
path - string - a file path]],
|
||||
Description = [[launch_default_app allow to open file in application that is assigned as default
|
||||
one in users's system for given filetype
|
||||
]],
|
||||
Return_Value = [[path - string - a file path]],
|
||||
Description = [[launch_default_app allows opening a file in the application that is assigned as default
|
||||
for that filetype in the users's system]],
|
||||
Return_Value = [[result - the return value signalling success or failure.]],
|
||||
Limitations = [[]],
|
||||
Example = [[]],
|
||||
See_Also = [[]],
|
||||
|
||||
Reference in New Issue
Block a user