[futurebasic] Re: [FB] Scan Files & Folders for OS X (was -38 errors)

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2006 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Sat, 21 Jan 2006 01:17:03 +0100
> Steve Crossman a écrit :
>>
>> this is placed per your instructions. I can get it to work by just  
>> creating a global FSpec array, but I am trying to grasp your approach  
>> of placing it into one big handle.

An additional note with that approach (storing an array of FSSpecs in a 
handle): you might face problems with Mac OS 9 because memory can move 
easily. This happened to me once and I spent many hours before I 
realized what was going on. I was sending an FSSpec item to a function 
that called the Navigation Services which is prone to eat a lot of 
memory, so my FSSpec ended up holding garbage when the relocatable block 
was moved. The solution is to lock the handle before calling the 
function and unlock it afterward or copy the incoming FSSpec in a local 
FSSpec variable as soon as the function called is entered. This is a 
vicious bug, because your program might work for some time then all of a 
sudden it starts to lose its marbles.

Alain