CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Writing binary to binary files...

 



ciigma
New User

Dec 17, 2008, 10:37 AM

Post #1 of 5 (550 views)
Writing binary to binary files... Can't Post

I have spent awhile googling around for an answer to this but I can't seem to find one:

I want to be able to write to an output file 2 bits at a time.

I tried creating and opening an output file and then calling "binmode", but everything I write to the file still seems to be in plain old ASCII (1 byte chunks).

Any ideas? Thanks :)


KevinR
Veteran


Dec 17, 2008, 11:15 AM

Post #2 of 5 (540 views)
Re: [ciigma] Writing binary to binary files... [In reply to] Can't Post

posting your code might help although I have a suspicion I won't be able to help with your question. Or ask on www.perlmonks.com
-------------------------------------------------


ciigma
New User

Dec 17, 2008, 11:19 AM

Post #3 of 5 (539 views)
Re: [KevinR] Writing binary to binary files... [In reply to] Can't Post

well, is it even possible to write to a file 2 bits at a time with perl?


KevinR
Veteran


Dec 17, 2008, 11:29 AM

Post #4 of 5 (537 views)
Re: [ciigma] Writing binary to binary files... [In reply to] Can't Post

If it is possible I don't know how. Its not something I have ever needed to do and its a question I have never seen posted on a perl forum before. I think your best bet at this time is to ask on www.perlmonks.com
-------------------------------------------------


FishMonger
Veteran / Moderator

Dec 17, 2008, 11:35 AM

Post #5 of 5 (535 views)
Re: [ciigma] Writing binary to binary files... [In reply to] Can't Post


In Reply To
well, is it even possible to write to a file 2 bits at a time with perl?


Yes it is. Read these docs

perldoc -f sysopen
perldoc -f syswrite

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives