How to open a directory?
Moderators: Víctor Paredes, Belgarath, slowtiger
How to open a directory?
Probably LUA a script to open a directory and to receive the list of files?
Something like this will allow the user to select from a list of files:
Regards, Myles.
Code: Select all
local infilename = LM.GUI.OpenFile("Select Input File")
if (infilename == "") then
return
end
local f = io.open(infilename, "r")
Thanks, I am well familiar with this script
The list of files of a directory is necessary
As in other programs:
DIR
.
..
file1
file2
file3
..........
file(n)
I it need to import sequence of raster images
As in other programs:
DIR
.
..
file1
file2
file3
..........
file(n)
I it need to import sequence of raster images
- Lost Marble
- Site Admin
- Posts: 2355
- Joined: Tue Aug 03, 2004 6:02 pm
- Location: Scotts Valley, California, USA
- Contact:
The Lua interface can't give you a directory listing, but consider this:
1. Bring up a file dialog and let the user pick the first file.
2. The user picks "image_001.jpg"
3. The Lua script then starts loading "image_002.jpg" "image_003.jpg" "image_004.jpg" etc.
Assuming the images are numbered in sequence, Lua can just open them one at a time. Instead of a directory listing, Lua can guess the next file's name based on the last one and just has to check whether each file exists or not.
1. Bring up a file dialog and let the user pick the first file.
2. The user picks "image_001.jpg"
3. The Lua script then starts loading "image_002.jpg" "image_003.jpg" "image_004.jpg" etc.
Assuming the images are numbered in sequence, Lua can just open them one at a time. Instead of a directory listing, Lua can guess the next file's name based on the last one and just has to check whether each file exists or not.