|new( THINGY, [ \%attr ] )||
Constructor of Mac::Macbinary. Accepts filhandle GLOB reference,
FileHandle instance, IO::* instance, or whatever objects that can do
If the argument belongs none of those above, new() treats it as a path to file. Any of following examples are valid constructors.
new() throws an exception Cant read blahblah if the given argument to the constructor is neither a valid filehandle nor an existing file.
The optional \%attr parameter can be used for validation of file format. You can check and see if a file is really a Macbinary or not by setting validate attribute to 1.
Following accessors are available via Mac::Macbinary::Header instance.
data returns the data range of original file. header returns the header object (instance of Mac::Macbinary::Header).
name, type, creator, flags, location, dflen, rflen, cdate, mdate returns the original entry in the header of Macbinary file. Below is a structure of the info file, taken from MacBin.C
char zero1; char nlen; char name; char type; 65 0101 char creator; 69 char flags; 73 char zero2; 74 0112 char location; 80 char protected; 81 0121 char zero3; 82 0122 char dflen; char rflen; char cdate; char mdate;
Some versions of MSIE for Macintosh sends their local files as Macbinary format via forms. You can decode them in a following way:
Copyright 2000 Tatsuhiko Miyagawa <firstname.lastname@example.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Macbinary.pm is originally written by Dan Kogai <email@example.com>.
There are also Mac::Conversions and Convert::BinHex, working kind similar to this module. (However, Mac::Conversions works only on MacPerl, and Convert::BinHex is now deprecated.) Many thanks to Paul J. Schinder and Eryq, authors of those ones.
perl(1), Mac::Conversions, Convert::BinHex.
|perl v5.20.3||MACBINARY (3)||2004-07-02|