Here is how to demonstrate this problem:
(234567$a.) 1!:1 <'testfile'
require'jmf'
JCHAR map_jmf_ 'TESTFILE';'testfile'
example=: 3 :0
assert.1=0
)
At this point:
(234567$a.) -: 1!:1 'testfile'
1
However, if we turn on debugging (control-K in J6 ide) and execute
example TESTFILE
(234567$a.) -: 1!:1 'testfile'
0
Until this gets fixed, jmap_jmf_ should probably be assumed to
[lazily] destroy the named file.
--
Raul
On Sat, Jan 14, 2012 at 12:47 PM, Raul Miller <[email protected]> wrote:
> jdb_fixopen from system/extras/util/debugs.ijs will throw an exception
> when it tries to modify a memory mapped file.
>
> I believe the significant lines are:
>
> t=. y
> t=. jdb_curtail ,t
>
> So, if you are debugging a verb where (for example) y is a large
> mapped file, and you get any kind of error in that verb, the file will
> be damaged if you have not anticipated the problem and made the file
> read only. One way you could anticipate the problem would be to have
> had the file get corrupted, and recover the file from backup and mark
> the file read-only before reaching the part of the code that needed
> debugging.
>
> This is in J6. I expect it would happen in J7, if J7 had a debugger.
>
> --
> Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm