PsionicMan has asked for the wisdom of the Perl Monks concerning the following question:
Seems easy, right? Well, I don't just want a text file full of 101010101010. I want to write to the file in binary mode, if you will. So the 1010110101 that the program gets in will be the actual 1's and 0's that make up the new file.
In case you were wondering, I know the format of a certain type of file and am trying to make a script to automate a portion of the editing/creation process. I would normally edit this file in a hex editor.
--Psi
print(pack("h*","e4f64702566756e60236c6f637560247f602265696e676021602075627c602861636b65627e2")."\n");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Writing a string of bits to a file, binary-style
by Zaxo (Archbishop) on Jun 15, 2001 at 02:07 UTC | |
|
Re: Writing a string of bits to a file, binary-style
by tachyon (Chancellor) on Jun 15, 2001 at 02:21 UTC | |
|
Re: Writing a string of bits to a file, binary-style
by btrott (Parson) on Jun 15, 2001 at 02:09 UTC | |
|
Re: Writing a string of bits to a file, binary-style
by bikeNomad (Priest) on Jun 15, 2001 at 02:13 UTC |