Waldek Hebisch wrote:
Frank Heckenbach wrote:
BTW, I have plans to change the internal structure of files again (not urgent). These will probably make access after `Finalize' not crash, but treat the file just as closed and unbound. But that's not my primary motivation for the change, and I wouldn't like to officially guarantee that behaviour then either.
IMHO we can easily get such behaviour with current structure. We just need to pre-allocate one "invalid" FDR and change `Finalize' so that a) it does not mess with this FDR b) after finalization it makes files point to this FDR
I guess we could do so. I'm just not convinced whether we should. IMHO access after `Finalize' is just as invalid as access trough a dangling pointer or whatever. We don't check the latter (and probably won't do anytime soon), so is there anything special about `Finalize'? However, with your method I see a problem as well: If someone actually accesses files after `Finalize' they will use this dummy FDR. So they could do any kind of operations with it. And several finalized files would even share this FDR which could lead to quite a mess AFAICS. What I'll rather do is to set the pointer to nil on `Finalize' so that every attempt to use it will fail right away (reliably and at the point of the first invalid access, rather than randomly sometime later). Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: ACB3 79B2 7EB2 B7A7 EFDE D101 CD02 4C9D 0FE0 E5E8