On 02/02/2003 at 13:33 -0500, Beth Chaplin wrote:

I have written a perl script that runs on my OS X system (through the
terminal), and produces a text output file that is meant to be later read by
a Mac application (Filemaker Pro, which imports the data from the file into
a database).

The problem: When Perl creates the text file, it does not get assigned the
proper 'file type'. Instead of being recognizable by the Mac system as a
text file, it has the file type '????', and most Mac applications do not
recognize it. Is there any way in perl (or UNIX) to change the file type of
a newly created file without having to do it manually through the Mac GUI? I
get the feeling that this problem has something to do with the unique way
the Mac system assigns file types.
I assume you have the Developer Tools installed. These install a pair of tools called SetFile and GetFile Info:

blech@piezo:~$ /Developer/Tools/SetFile --help
Usage: SetFile [option...] file...
-c creator # file creator
-t type # file type

(Edited for space. There are many more options.)

For example, "/Developer/Tools/SetFile -t 'TEXT' -c 'R*ch' new.txt" will make BBEdit the default application for opening the text file "new.txt".

However, under Mac OS X, you should also be able to get away with merely setting a text extension. For a full description of how double-clicking a file chooses which application handles it, you'll want to examine the Launch Services documentation:

http://developer.apple.com/technotes/tn/tn2017.html

You might also want to look at the [EMAIL PROTECTED] mailing list:

http://lists.perl.org/showlist.cgi?name=macosx

Cheers,

--
:: paul
:: we're like crystal
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to