Getting Every File for "OS"
Started by PixelFox, Apr 13 2015 08:33 PM
9 replies to this topic
#1
Posted 13 April 2015 - 08:33 PM
My "Operating System" (It can't really be called that...It's more that the file explorer in windows or the finder in mac)
I want to find every single file BUT the system files, .menu and .gui, and save them in a variable or something that I can manipulate, so I can show them in the GUI or Graphical User Interface. I really can't find out how, is there some kind of simple something to do that with, and also, will it show APIs also?
I want them to be able to see the APIs. But I'll make them a different Icon.
I want to find every single file BUT the system files, .menu and .gui, and save them in a variable or something that I can manipulate, so I can show them in the GUI or Graphical User Interface. I really can't find out how, is there some kind of simple something to do that with, and also, will it show APIs also?
I want them to be able to see the APIs. But I'll make them a different Icon.
#2
Posted 13 April 2015 - 08:39 PM
Are you trying to build a desktop? I don't quite understand your question, could you please clarify?
#3
Posted 13 April 2015 - 08:43 PM
Creator, on 13 April 2015 - 08:39 PM, said:
Are you trying to build a desktop? I don't quite understand your question, could you please clarify?
Edited by Lightning, 13 April 2015 - 08:44 PM.
#4
Posted 13 April 2015 - 08:47 PM
Your best bet is to use a table.
If i remember correctly fs.list returns a table of all the files in a given dirrectory. So using this you could use a loop that will loop through all of the files check if they are a dirrectory, and if they are then loop through all the files in that dirrectory and so on.
This will not however get the apis. The easiest way I can think to get the apis would be to do something similar to do this
If i remember correctly fs.list returns a table of all the files in a given dirrectory. So using this you could use a loop that will loop through all of the files check if they are a dirrectory, and if they are then loop through all the files in that dirrectory and so on.
This will not however get the apis. The easiest way I can think to get the apis would be to do something similar to do this
for k,v in pairs(_G) do
if type(v) == "table" then
-- its most likely a api so do something with it
end
end
#5
Posted 13 April 2015 - 08:48 PM
valithor, on 13 April 2015 - 08:47 PM, said:
Your best bet is to use a table.
If i remember correctly fs.list returns a table of all the files in a given dirrectory. So using this you could use a loop that will loop through all of the files check if they are a dirrectory, and if they are then loop through all the files in that dirrectory and so on.
This will not however get the apis. The easiest way I can think to get the apis would be to do something similar to do this
If i remember correctly fs.list returns a table of all the files in a given dirrectory. So using this you could use a loop that will loop through all of the files check if they are a dirrectory, and if they are then loop through all the files in that dirrectory and so on.
This will not however get the apis. The easiest way I can think to get the apis would be to do something similar to do this
for k,v in pairs(_G) do if type(v) == "table" then -- its most likely a api so do something with it end end
I know some fs commands...I'll look up the the API later, and thanks with the APIs too.
Oh also, I'm trying to overright a file, and fs.copy returns "testfile:4: File Exists" is there a way to stop that?
Edited by Lightning, 13 April 2015 - 08:53 PM.
#7
#8
#9
#10
Posted 14 April 2015 - 11:53 PM
If you want to find every single file on the computer you'd need to use a recursive loop
Example
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











