D
Dirk Einecke
Hi.
I've a method to read the content of a file.
def readFile(path)
value = ''
file = File.open(path, File::RDONLY)
while line = file.gets do
value += line
end
file.close
return value
end
I think the way line by line is not very efficiently.
Is there a shorter way to get the content of a file?
greetings
Dirk Einecke
I've a method to read the content of a file.
def readFile(path)
value = ''
file = File.open(path, File::RDONLY)
while line = file.gets do
value += line
end
file.close
return value
end
I think the way line by line is not very efficiently.
Is there a shorter way to get the content of a file?
greetings
Dirk Einecke