I'm using MacOSX::File::Info to get the Type and Creator codes for files.
In trying to print these (e.g., via NSLog and in an NSTextView), I ran
into a peculiar symptom: not only did the code not print, any following
information on the line also disappeared.

After a bit of research, I confirmed that the creator and type methods
were returning a string of four nulls when no real code was available.
This is probably normal behavior in Macland, but it's distinctly non-
Perlish.  Sigh.

Anyway, my workaround was to generate my own string of four nulls,
which I could use to check return values:

  my $null = "\000\000\000\000";

  $tmp = $finfo->creator;
  $tmp = '' if ($tmp eq $null);
  row('  Creator', "'$tmp'");

  $tmp = $finfo->type;
  $tmp = '' if ($tmp eq $null);
  row('  Type', "'$tmp'");

-r
--
email: [EMAIL PROTECTED]; phone: +1 650-873-7841
http://www.cfcl.com/rdm    - my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc     - Prime Time Freeware's Darwin Collection

Reply via email to