Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function loadUserFile()
- User = {} -- Not sure if you define that anywhere else.
- local i = 1
- print("Checking "..sPasswdPath.." exists...")
- if fs.exists(sPasswdPath) then
- file = io.open(sPasswdPath, "r")
- print ("Loading file....")
- while true do
- User[i] = file:read()
- if User[i] == nil then i = i - 1 break end
- print ("User "..i..": "..User[i])
- i = i + 1
- end
- else
- print "Error: Password file doesn't exist."
- end
- return i -- returns the last user that was valid and printed
- end
Add Comment
Please, Sign In to add comment