Skip to content

Commit

Permalink
win32 compatible temp file handling (thanks, Gábor Oláh https://githu…
Browse files Browse the repository at this point in the history
  • Loading branch information
virtan committed Aug 24, 2014
1 parent c7f5e61 commit 635d09b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/eep.erl
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,13 @@ subcall_update({SMFA, SCalls}, SubCalls, SpentInSub) ->
save_kcachegrind_format(FileName) ->
erlang:process_flag(priority, high),
RealFileName = kcgfile(FileName),
case file:open(RealFileName, [read, write, binary, delayed_write, read_ahead]) of
TempFileName = case os:type() of
{win32, _} -> RealFileName ++ ".tmp";
_ -> RealFileName
end,
case file:open(TempFileName, [read, write, binary, delayed_write, read_ahead]) of
{ok, IOD} ->
file:delete(RealFileName),
file:delete(TempFileName),
{ok, Timer} = timer:send_interval(1000, status),
{GTD} = save_receive_cycle(IOD, 1, ts(os:timestamp()), 0, ts(os:timestamp()), <<>>, 0, undefined),
timer:cancel(Timer),
Expand Down

0 comments on commit 635d09b

Please sign in to comment.