[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl files creator code



Sometime around 7/30/98 11:43 AM, Vicki Brown wrote something about:

>However, by my first understanding of the discussion, i.e. the context
>within which I made the statement, it is very unusual for Apps to write
>their documents with a different creator ID.  For example, everything in my
>Eudora Folder is CS0m.  (Except the log files and I don't know why not).

     By default, text files created by MacPerl scripts have the creator 
'MPS ', which is MPW... this is the __default__ out-of-the-box setting... 
most likely because Matthias is an MPW addict (like me  ;)... so right 
off, barring use of MacPerl::SetFileInfo, a file created by a MacPerl 
script will __not__ open in MacPerl when 2clicked.

>But even talking output files (not scripts), forcing one creator type seems
>unflexible.  So I need to ask, if it matters to you, why not just use
>MacPerl::SetFileInfo to get exactly what you want every time?

     Why do it more than once when you don't have to?  This is clearly a 
TMTOWTDI issue...

     In the spirit of the Principle of Laziness, we can set a default 
file creator type for output files, and can override that in individual 
scripts using MacPerl::SetFileInfo... many of my scripts must run under 
Mac, Solaris and Linux, and I really don't want to have to remember to do 
this in every one:

if ( $^O eq 'MacOS' ) {
     # do SetFileInfo stuff here, which could be long and involved
     # if there are a lot of output files
}

     If I __do__ need to have a different creator (than the default 
specified in the app) in a specific instance, I can do this in that one 
script, secure in the knowledge that my other scripts will still output 
files that I can 2click into my editor of choice...

     And just think of all the things you could do with the time saved by 
not having to do MacPerl::SetFileInfo in all your scripts...  ;)

Dave

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch