23 posts
Posted 23 June 2012 - 07:40 PM
Can somebody tell me how to check for a file on a disk? I'm trying to make a system that checks for a specific access level on a disk and runs a program accordingly. I just cant figure out how to use fs api. The wiki is no help and checking around the forums is no help either… I just need to know how to check for a file called "Lv1" when a disk is inserted.
797 posts
Posted 23 June 2012 - 07:46 PM
Im not sure how to do it so it checks when you put the disk in but
if fs.exists("Lv1") then
(what you want it to do)
else
(what you want it to do)
end
that will check if it exists and do something if it does…
23 posts
Posted 23 June 2012 - 07:50 PM
That makes sense. To check for an inserted disk its
local evt, side = os.pullEvent("disk")
By the way
797 posts
Posted 23 June 2012 - 07:51 PM
Cool thanks
1604 posts
Posted 23 June 2012 - 08:09 PM
Im not sure how to do it so it checks when you put the disk in but
if fs.exists("Lv1") then
(what you want it to do)
else
(what you want it to do)
end
that will check if it exists and do something if it does…
Just remember to use "disk/Lv1", since the fs api needs absolute paths and the file is in the disk.