Fri 24 Jan 2014 09:26:24 AM UTC, original submission:
(Also present in 3.8.0 mingw mxe-cross-built)
Steps to reproduce:
- Put attached script tmpf.m & file template.ods into same subdir.
(tmpf.m reproduced below for clarity:
- Run tmpf.m, note name of temp file <tmpfil> (e.g., /path/to/temp/dir/oct-3)
- Watch contents of temp directory: I get a file called oct-4 instead of oct-3.
It turns out I can very reliably reproduce this on my XP and Win 7 boxes at home.
Furthermore,
...gets me a temp file called 'oct-24" rather than "oct-21".
The effect is that unlinking temp files gets a bit hard, so over time the temp dir gets cluttered with tens or hundreds of temp files.
As to reproducability:
Sometimes this works OK. But once some unknown condition ("nasal demon"? thanks Jordi for that term!) has been triggered, the above behavior is consistent, also over restarts of Octave.
(Sorry for guessing) I can't put a finger on it, but maybe it is due to the unpack statement of the .ods file (effectively a plain .zip file with .ods suffix). Or maybe it is related to a timing issue in the OS.
Is there a way to find out the file name associated with a particular file handle, or to delete a file by its file handle? That would make it easier to delete temp files and could be a good workaround for this bug.
|