Close the file after reading it.

This commit is contained in:
Simon MacMullen 2008-11-27 14:24:14 +00:00
parent 133fd99caf
commit fdab4fc061
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,8 @@ code_change(_OldVsn, State, _Extra) ->
%% eof. %% eof.
read_proc_file(File) -> read_proc_file(File) ->
{ok, IoDevice} = file:open(File, [read, raw]), {ok, IoDevice} = file:open(File, [read, raw]),
read_proc_file(IoDevice, []). read_proc_file(IoDevice, []),
file:close(IoDevice).
read_proc_file(IoDevice, Acc) -> read_proc_file(IoDevice, Acc) ->
case file:read(IoDevice, ?BUFFER_SIZE) of case file:read(IoDevice, ?BUFFER_SIZE) of