This is some code which I created to read a file into a list tail first. In this case, I need to search for something in the file from the end first so this works out perfectly for what I need.
def file_into_list_tailfirst(file) do
:io.setopts(:standard_io, encoding: :latin1)
File.open!(file)
|> IO.binstream(:line)
|> Enum.reduce([], fn(line, acc) -> [line|acc] end)
end
(Also posted here)
Would appreciate any comments anyone cares to share.






















