I I work on a project consisting in copying whatever their names all the files found in a Windows folder and placing them in another folder by reversing them File1, File2, etc.
It seems to me that I can’t do that with the simulator. But with the os.execute code I only manage to copy a single known file while reversing it. It seems that plugin_tinyfiledialogs can do that but it is not up to date and the simulator does not find it.
Any ideas ?
This is possible in C, C#, C ++ but I don’t know how to call a module written in C ++ or C# in LUA.
To my understanding, you cannot move and rename multiple files at the same time in a single call. The move command moves a single file or all files from source to destination. If renaming then it only moves 1 file; the one being renamed.
There are multiple ways to go about it, but either way will require multiple calls. Either rename all and move all, or move all and rename all, or loop to rename and move each file at a time.
@StarCrunch , there’s a reference to msvcr120.dll, and confirmed it’s being loaded. This is the same issue we came across about 2 weeks ago with the OpenSSL plugin, it requires VS2013 x86 distro.
@steevemoore , batch renaming can be as simple as ren "video*.mp4" "file*.mp4"; however, the problem here is (if your sample code was literal) that you’re renaming a 5 letter string to 4 letters, and I don’t see ren be flexible enough to remove a character in the middle, otherwise ren "video*.mp4" "file_*.mp4" would be more appropriate.
Okay, looks like the Windows build was indeed built against an earlier version. I rebuilt (with author updates too) and the new version should be live now.
based on your code I consider the following scripts for my project :
`
local tfd = require( "plugin.tinyfiledialogs" )
local widget = require( "widget" )
widget.setTheme("widget_theme_android_holo_dark")
for _, button in ipairs{
{ label = "Open File",
action = function()
local file = tfd.openFileDialog{ }
-----------I don't know what code I have to insert here to transfer the chosen file to Documents
------ os.execute is an outside code and does not work
end
},
}
do
if button then
local action = button.action
widget.newButton{
label = button.label,
onEvent = function(event)
if event.phase == "ended" then action() end
end
}
end
end`
I don’t know what code I have to insert and where to pass my code to transfer the chosen file to Documents.