[Vm-dev] About SQFile's fileSize field
leves at caesar.elte.hu
Wed Oct 11 21:41:37 UTC 2017
That's exactly what I'm trying to remove here, the cached size field,
because it won't be updated when a file is opened more than once from
the image. And that's not a rare case, because that's how the .changes
file are used.
On Wed, 11 Oct 2017, John McIntosh wrote:
> And the only comment I ever got was the cached value confused some Squeak app that someone wrote so they make their own VM to pull the file size from the file system on each request
> Sent from my iPhone
>> On Oct 11, 2017, at 17:00, tim Rowledge <tim at rowledge.org> wrote:
>>> On 11-10-2017, at 1:40 PM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
>>> I went ahead a bit, removed the field, updated the sources, and compiled a VM with the changes. It works fine on linux. I've updated the windows and mac files too, but I can't test those.
>>> There are some remaining references to the removed field in the RiscOS platforms file, but I don't really know what to do with that. The code seems to be using platform specific calls to implement the plugin, which is unusual, but may be more efficient than the generic C implementation.
>> It’s been a while since I had to write that code but it was a complete replacement for the plugin C code. Part of the problem is/was the use of separate position and read/write steps that I found could happen interleaved in some places thus writing complete nonsene into changes files etc. Part of it was the copying of file IDs and expecting that you could always read and write properly. So I had to implement an entire layer above the RISC OS file handling to track file opening/closing and … etc etc. The good news is nobody (and surprisingly quite a few people used Squeak on RISC OS) ever found a single bug.
>> Anyway, more to the point, I vaguely recall that I had to (ab)use the size field for something or other.
>> Ah, nope, it was the lastOp field according to the comments in the C code. Wow, comments in C code - who’d ever expect that?
>> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
>> Strange OpCodes: DNPG: Do Not Pass Go
More information about the Vm-dev