8 bit os_f handles

Jonathan Coxhead jonathan at doves.demon.co.uk
Tue Mar 28 21:28:37 BST 2000


   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|.

 | 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.

        /|
 o o o (_|/
        /|
       (_/



More information about the oslib-user mailing list