On Mar 23, 2007, at 19:34 UTC, Tim Jones wrote:

> Understood.  However, it appears that simply setting a MacType to  
> something has resolved this (at least for now).  As a test, I set the
> MacType to "DUMB" and the Extensions to "tgz;tar.gz" and now only the
> appropriate files are displayed.  So, it looks like so long as teh  
> MacType is not empty, the Extensions setting will be used.

You've stumbled on almost the right solution, but without understanding
why.  (Of course I realize that you hadn't seen my emails yet when you
wrote this, so maybe it's clear by now.)  You don't want to set the
MacType to "DUMB" unless you find there is some gzipped-tarball-making
tool out there that actually uses that as their MacType.  Instead, you
should make up one that is as likely as possible to actually mean
"gzipped tarball file".  Or better yet, find one that's already in use.
I know it's unlikely, but you must make your code prepared to handle
two things:

1. Actual gzipped tarballs that have a sensible MacType but lack the
standard extension.

2. Files that are NOT gzipped tarballs, that might have whatever
MacType you pick.

But carefully choosing the MacType, you make it more likely that if
some file has that type, it will fill into category 1 (good) and not
category 2 (bad).

Usually a bit of googling will turn up either a documented file type
already in use, or a reasonably well-known application that creates
such files, in which case you can grab it, try it, and see what MacType
it uses.

And just to be clear, this is all working as it's supposed to; the open
dialog shows files which match the MacType you specify, OR which have
no type and match the extensions you specify.  This correctly handles
both cases of typed files (where extensions shouldn't matter) and
untyped ones (where extensions are all you have to go on).

The gotcha here is that a blank MacType compiles as a wildcard.  Maybe
it should instead be a compile-time error, or throw an exception if you
try to use it on a Mac, so that you're forced to use "????" when you
really mean a wildcard.

Cheers,
- Joe

--
Joe Strout -- [EMAIL PROTECTED]
Verified Express, LLC     "Making the Internet a Better Place"
http://www.verex.com/

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to