Skip to content

Commit

Permalink
Compiled file is now deleted initially only if it existed
Browse files Browse the repository at this point in the history
  • Loading branch information
lmendo committed Jan 25, 2016
1 parent a7762eb commit d48b071
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions matl_compile.m
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,14 @@

% Write to file:

delete(cOutFile) % even though `fwrite` discards the file's previous contents, and there's a `clear`
% later, I delete the file initially here. I do it just in case: at some point I've
% seen Octave run an old version of the compiled file after changing the source code (which produces
% a new compiled file). I think this must a a file cache thing. (Even accidentally deleting a file
% before attemtping to run it sometimes resulted in a successful run!) I'm not sure how helpful
% deleting the file will be, though.
if exist(cOutFile,'file')
delete(cOutFile) % even though `fwrite` discards the file's previous contents, and there's a `clear`
% later, I delete the file initially here. I do it just in case: at some point I've
% seen Octave run an old version of the compiled file after changing the source code (which produces
% a new compiled file). I think this must a a file cache thing. (Even accidentally deleting a file
% before attemtping to run it sometimes resulted in a successful run!) I'm not sure how helpful
% deleting the file will be, though.
end
fid = fopen(cOutFile,'w');
for n = 1:numel(C)
if ispc % Windows
Expand Down

0 comments on commit d48b071

Please sign in to comment.