McKown, John wrote:
I'm asking this question due to a discussion on another forum. Suppose I
have a file which contains binary data. That it, lots of weird binary
data, not text. Is there a "zap" type program which can modify arbitrary
bytes within that file? Basing this vaguely on the z/OS AMASPZAP
program, I might have a terminal session like:

zap binary.file
ver 0120 005c,872c
rep 0120 015d,9368

This would mean to open the file "binary.file" in binary mode. Verify
that the contents of the file, starting at offset x'0120' contain the
hex value "005c872c". If not, then set a "no update" flag to ignore
subsequent commands. If so, then do the "rep" command to replace those
bytes with "015d9368". This program should also allow multiple ver
commands and multiple rep commands. Oh, and the ver and rep offsets need
not be the same (though I would think that they likely would be).

I've never heard of such a thing, but what I do know? (not much!).
Look at patch(1) with the --binary option.

--binary
Read and write all files in binary mode, except for standard output
and /dev/tty. This option has no effect on POSIX-conforming sysb
tems. On systems like DOS where this option makes a difference, the
patch should be generated by diff -a --binary.


Kim

--
Kim Goldenberg
Systems Programmer I
State of NJ - OIT
609-777-3722
[EMAIL PROTECTED]
[EMAIL PROTECTED]

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to