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

Re: [MacPerl] Problem w/SetFileInfo



At 10.01 -0600 1999.08.06, Brenda Cannon wrote:
>I am running Macperl 5.2.0r4 on System 8.0. I would appreciate any
>insight as to what I am doing wrong here.  I am trying to set the file
>creator and type right before I close three files.  I put the print
>statements in to ensure that I was actually using the $Config{'osname'}
>correctly. It appears that I am using it correctly--when I run my
>program it does print the first debug statement, but the file creator
>and type are "MPS " and "TEXT".
>
>
>	if ($Config{'osname'} =~ m/^macos/i) {
>	#for mac os

This is not an error, but a better way to do this is with equality, not a
regex, and using $^O is faster than using %Config.

  if ($^O eq 'MacOS') {  # cleaner, faster


>		&MacPerl::SetFileInfo("MSWD", "TEXT", MCERROR, MCSTATS,
>MCHEADS);

You run it on filenames, not filehandles.

  MacPerl::SetFileInfo('MSWD', 'TEXT',
    "path:to:file1", "path:to:file2");

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org