file=io.open ("sys/lua/fil.txt","r")
if(file==nil)then
print("can not open fil.txt")
else
data=file:read()
if(data==nil)then
print("error")
end
end
and it do not say:"can not open fil.txt" but say "error",wtf,why it can not read it ?
Scripts
WTF working with files
WTF working with files
1

Re: WTF working with filesfile=io.open("sys/lua/fil.txt","r")
if(file==nil)then
	print("cannot open fil.txt")
else
	data=file:read("*n")
	if(data==nil)then
		print("error")
	else
		print(data)
	end
end
sample = 1
if sample then
print(sample)
else
print("Sample equals nil!")
end
1
