Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
#! /usr/bin/env escript
|
||||
|
||||
main( Arguments ) ->
|
||||
display_notes( Arguments ),
|
||||
save_notes( Arguments ).
|
||||
|
||||
|
||||
|
||||
display_notes( [] ) -> io:fwrite( "~s", [erlang:binary_to_list(file_contents())] );
|
||||
display_notes( _Arguments ) -> ok.
|
||||
|
||||
file() -> "NOTES.TXT".
|
||||
|
||||
file_contents() -> file_contents( file:read_file(file()) ).
|
||||
|
||||
file_contents( {ok, Binary} ) -> Binary;
|
||||
file_contents( {error, _Error} ) -> <<>>.
|
||||
|
||||
save_notes( [] ) -> ok;
|
||||
save_notes( Arguments ) ->
|
||||
Date = io_lib:format( "~p~n", [calendar:local_time()] ),
|
||||
Notes = [Date ++ "\t" | [io_lib:format( "~s ", [X]) || X <- Arguments]],
|
||||
Existing_contents = file_contents(),
|
||||
file:write_file( file(), [Existing_contents, Notes, "\n"] ).
|
||||
Loading…
Add table
Add a link
Reference in a new issue