Posted 07 June 2015 - 11:51 AM
We need a code that will find out whether there is a folder at least one file.
I'm going to do with the function of the operating system on your computer desk. If a folder with accounts no file (account), the screen will display a license agreement and registration. If there is at least one file, it will display a login screen.We don't give out code. We like to see attempts at solving the problem and the issues you're facing so that we can help you with the code further. I suggest you take a look at the FS API.
On FS API I looked. But nothing could be done.We don't give out code. We like to see attempts at solving the problem and the issues you're facing so that we can help you with the code further. I suggest you take a look at the FS API.
If it's only one file, and you know what file you're looking for you could use fs.exists.- snip -
local directory = "username"
local file = "user.data"
if fs.exists( fs.combine( directory, file ) ) then
--# The file existed
else
--# The file was not in the folder
end
If it's just some random files and you just want to make sure the folder isn't empty you can use fs.list
local directory = "username"
local list = fs.list( directory )
if #list > 0 then
--# There are files in the folder
--# But do note that this may not be the case
--# because it may have found another empty
--# folder in the folder and added it to the list
else
--# The directory was empty
end
Thank you =)If it's only one file, and you know what file you're looking for you could use fs.exists.- snip -If it's just some random files and you just want to make sure the folder isn't empty you can use fs.listlocal directory = "username" local file = "user.data" if fs.exists( fs.combine( directory, file ) ) then --# The file existed else --# The file was not in the folder end
local directory = "username" local list = fs.list( directory ) if #list > 0 then --# There are files in the folder --# But do note that this may not be the case --# because it may have found another empty --# folder in the folder and added it to the list else --# The directory was empty end