8 bit os_f handles
David J. Ruck
druck at freeuk.com
Tue Mar 28 23:36:33 BST 2000
On Tue 28 Mar, Jonathan Coxhead wrote:
> David wrote,
>
> | Take this example using the current OSLib:-
> |
> | os_f f = osfind_openin(osfind_NO_PATH, info.filename, NULL);
> | osgbpb_read(f, (byte*)&decomp, sizeof(bits));
> | osfind_close(f);
> |
> | This compiles to:-
> |
> | [...]
> |
> | As you can see because OS_Lib returns values in regsiters and those
> | regsiters are passed directly to the other filing system functions,
> | the 32bit file handles are maintained.
>
> Ouch! You are quite right, it's worse than I thought!
>
> But the solution isn't to introduce our own bugs into other
> people's code. The solution is to make sure that anyone who wants to
> use a 32-bit aware FileSwitch knows that they have to use file
> handles of type |os_w|.
Ok if you are happy that some time in the near future when 32-bit aware
FileSwitch is released, under certain cicumstances various application may
start suffering from unsual failures, and users will find files are
becomming corrupted. Eventually someone will track this down to the fact it
was built with OSLib and has left in an 8 bit os_f using call.
The alternative is not much better as you cant elimitate all the software
built with old versions of OSLib out there, but you can make sure all
existing software still in development (and new ones obviously) can be
recompiled, tested and known to be safe.
> | Please belive me you dont want to have to track down these types of
> | problems with your code - you will not have a clue why certain filing
> | system code works, others dont, and changing the slightest thing can
> | alter it.
> You'll know exactly why---it's because you are using narrow
> handles. You'll be able to fix the problems (e g, using the technique
> I mentioned in my last message), and they'll go away. No big deal.
No you wont, you'll get the typical user bug reports; "your program crashes"
and RISC OS Ltd will get, "RISC OS 4.x is crap, since installing all my files
are corrupted".
What do other people think? There must be more than 4 of us on this list?
---Dave
--
______________________________________________________________________
David J. Ruck Phone: 07974 108301 Email: druck at freeuk.com
______________________________________________________________________
More information about the oslib-user
mailing list