On Sat, Nov 02, 2002 at 04:00:44PM -0600, John Pitchko wrote:

> I've been racking my brains out trying to get Perl to write binary
> files for me. Here is my situation. For my Operating Systems class, we
> are designing a file system. One of the requirements is that the file
> system needs to be saved to disk as a binary file. I have a few large
> array of arrays and hash of hashes in my code, so I was hoping to be
> able to use Data::Dumper to dump and retireve the data structures.
> However, I do not know how to open a file in binary mode (from what I
> understand, binmode() does not work for Unix which is the envrionment
> where I am coding) or write binary data to that file.

That depends on what you mean by "does not work".  I'll assume you're
not using layers for the moment.  If that is the case, then binmode
doesn't really have any work to do on Unix.  You can just read and write
your binary data.  This has been the case since Perl 3, about 13 years
ago I think.

> I was thinking that I would record the output from Data::Dumper into a
> scalar and write this scalar in binary mode to the disk. Can anyone
> give me any help with this????

I would suggest taking a look at Storable.

> All e-mails and attachments are certified virus free!

Phew!

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to