[Biococoa-dev] strider and gck format

Koen van der Drift kvddrift at earthlink.net
Sat Mar 11 07:14:33 EST 2006

On Mar 11, 2006, at 4:44 AM, Alexander Griekspoor wrote:

> Both the GCK and the Strider files are inherited from the good old  
> MacOS9 period. In those days you would identify files using a type/ 
> creator code, and that's what I check for in this code. You will  
> never see these 4 character codes unless you use a program like  
> resedit, and they are not the same as file extensions, in fact  
> under MacOS9 you would never use file extensions unless you wanted  
> your Windows buddies to open your word file as well. So  
> NSHFSTypeOfFile is not the same as [filepath pathExtension].
> The problem is that both filetypes are in binary format compared to  
> the other formats which are ASCII based. Trying to read in the file  
> as a string with ascii encoding creates some garbage which is  
> impossible to interpret, let alone determine the filetype from. So  
> the options were to either read all files in as data and check if  
> it would fit the header of either filetype, and try to make  
> anything out of that (quite tricky!) or simply to the filetype  
> check. As a result I changed the code to have it pass the filepath  
> instead of the raw text to the reader class. It better isolates  
> code (no more reading at all in the delegate class), but we  
> sacrifice the possibility to work with remote files. Guess this  
> could be easily added to through a readFileFromURL method.
> Now that I think of it, perhaps we should also check for the file  
> extensions that are added to GCK files if you create them on the  
> windows platform. I'm not sure if in those files the creator/type  
> codes are added, I could check that on monday...
> Hope this clears things up?

Yes, thanks!  I was trying to test your code in the framework using  
the Translation example. So I found some strider test file and read  
that in with the current code in Translation. The file works fine  
with your demo app. However in Translation it doesn't. Right now I use:

BCSequenceArray *sequenceArray = [sequenceReader readFileUsingText:  
[[NSBundle mainBundle] pathForResource: @"Strider" ofType:@"seq"]];

But that doesn't work. Maybe that should be changed to:

BCSequenceArray *sequenceArray = [sequenceReader readFileUsingPath:  
[[NSBundle mainBundle] pathForResource: @"Strider" ofType:@"seq"]];

I agree with you that passing the filepath is a better way of doing  
things. I will look into that this weekend.


- Koen.

More information about the Biococoa-dev mailing list