This commit is contained in:
Ingy döt Net 2013-06-05 21:47:54 +00:00
parent 1f1ad49427
commit 6f050a029e
2496 changed files with 37609 additions and 3031 deletions

View file

@ -0,0 +1,9 @@
void
read_stream(file f)
{
text s;
while (f_line(f, s) != -1) {
# the read line available as -s-
}
}

View file

@ -0,0 +1,8 @@
% Implemented by Arjun Sunel
-module(read_files).
-export([main/0]).
main() ->
Read = fun (Filename) -> {ok, Data} = file:read_file(Filename), Data end,
Lines = string:tokens(binary_to_list(Read("read_files.erl")), "\n"),
lists:foreach(fun (Y) -> io:format("~s~n", [Y]) end, lists:zipwith(fun(X,_)->X end, Lines, lists:seq(1, length(Lines)))).