Opening Files in OS X

Monte Goulding monte at sweattechnologies.com
Fri Jun 20 19:57:01 EDT 2003


>
> Thanks again Monte, I've done the reading, and I have a follow-up
> question,
> if you don't mind (or if anyone else has advice on this).
>
> My understanding is that Mac OSes use fileType to determine if a file
> "belongs" to an application.  Furthermore, it seems that the OS
> prevents my
> app from opening files that don't belong to it (judging from the docs and
> the way my app is currently behaving).  So what I need to do is set the
> fileType when my app saves a file, and then the app will be able
> to reopen
> that file later.

That's correct
>
> Is that right?  If so, what happens if a Windows user of my app creates a
> file and tries to share it with a Mac user of my app?  The docs suggest
> that Windows ignores fileType, so will the Mac user be prevented from
> opening files created by Windows users?

This is the reason why Apple is moving away from the resource fork. That and
it's a crap idea. For MacOS Classic you can use the File Exchange to
associate an extension with a file type and creator code. If you search the
list archives you will find some applescript to do this (it's probably also
on sonsofthunder & revnet like everything else ;-).

For OS X you use a plist file. It's an xml file that is in the package where
you can set the file extension, type code etc (that's one of my enhancements
to the dist builder). The only problem is that OS X is bad at assigning the
type code to the file. Often you get files that have the correct icon and
when you doubleclick open the app but when you ask file of type they are
greyed out because the type code isn't there. There's currently no fix for
this other than doubleclick and save. That's why I'm looking forward to
extension filters on OS X.

Cheers

Monte

>
> These files are just text files that have a *.upf extension in Windows.
>
> Thanks!
>
> Jim
>
> At 08:48 AM 6/20/2003 +0930, you wrote:
> >Read the docs on ask file. You need to use type codes on MacOS
> rather than
> >extension filters. Hopefully we will get extension filters for OS X soon.
> >
> >You will also need to read up on stackFileType and/or fileType to handle
> >your custom file type on MacOS & OS X.
>
>
>
> -------
> http://www.biancolo.com
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list