dir = disk.getMountPath("left") .. "/"
usersDir = dir .. "users"
passDir = dir .. "passwords"
function newUser(name, password)
openWrite()
for user in io.lines(usersDir) do
users:write(user)
end
for password in io.lines(passDir) do
pass:write(password)
end
users:write(name .. "\n")
pass:write(password .. "\n")
exit()
end
function openWrite()
users = io.open(usersDir, "w")
pass = io.open(passDir, "w")
end
function save()
users:flush()
pass:flush()
end
function close()
users:close()
pass:close()
end
function exit()
save()
close()
end
newUser("Strikinwolf", "meow")
newUser("trajing", "meow")
newUser("Strikingwolf", "hello")
for name in io.lines(usersDir) do
print(name)
end
for password in io.lines(passDir) do
print(password)
end