Welcome, Guest
Please Login or Register.    Lost Password?

Possibility of scanning a folder with lua
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Possibility of scanning a folder with lua
#7372
Possibility of scanning a folder with lua 6 Years, 1 Month ago  
Hi there,

is it possible to scan a folder?

I altered the flickr-photo-script to display pictures from my harddrive.

So far I made a batch-file that scanned my picture-folder and wrote the names and paths of its files into a textfile, which I then open in the lua-script to pick a random file which would then be displayed.

Is it possible to dismiss the batch-file and scan the folder within the lua-script? haven't really found anything on folder-scanning.

Thanks,

hachel

PS: oh, maybe you could tell me how to display the file probably, so far I've done it the complicated way ("a" being the array containing the filenames):
...
url = "file:///" .. a[random]

Rainlendar_Log("Downloading: " .. url)
Rainlendar_DownloadElement(url, Shadow4_Photos_OnDownloadElement, "bitmap.photos.photo", skin, window)
hachel
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#7382
Re:Possibility of scanning a folder with lua 6 Years, 1 Month ago  
I added the luaFileSystem library to Rainlendar so in the next version it will be possible to scan folders too.

Using the Rainlendar_DownloadElement() is actually the only way to change the images so at the moment it is the proper way .
Rainy
Moderator
Posts: 6000
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop