Skip to content

Commit 950dbfd

Browse files
committed
File MATLc.m was not being always deleted
because of a problem identified by Suever. See https://chat.stackexchange.com/transcript/message/34122132#34122132
1 parent 620763e commit 950dbfd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

matl_compile.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,12 +371,14 @@
371371
% Write to file:
372372

373373
if exist(cOutFile,'file')
374-
delete(cOutFile) % even though `fwrite` discards the file's previous contents, and there's a `clear`
374+
delete(which(cOutFile)) % even though `fwrite` discards the file's previous contents, and there's a `clear`
375375
% later, I delete the file initially here. I do it just in case: at some point I've
376376
% seen Octave run an old version of the compiled file after changing the source code (which produces
377377
% a new compiled file). I think this must a a file cache thing. (Even accidentally deleting a file
378378
% before attemtping to run it sometimes resulted in a successful run!) I'm not sure how helpful
379379
% deleting the file will be, though.
380+
% Initially the line above was `delete(cOutFile)`. I changed to `delete(which(cOutFile))`
381+
% following a conversation with Suever (https://chat.stackexchange.com/transcript/message/34122132#34122132)
380382
end
381383
fid = fopen(cOutFile,'w');
382384
for n = 1:numel(C)

0 commit comments

Comments
 (0)