Difference between revisions of "Bcopy"

From Scriptwiki
Jump to: navigation, search
m
 
m (corrected binary files-link)
Line 1: Line 1:
The bcopy command is used to copy a (part of a) [[Binary Files|binary file]].
+
The bcopy command is used to copy a (part of a) [[:Category:Binary Files|binary file]].
 
  <nowiki>bcopy [-zc] <&copy> <N> <&source> <S> <M></nowiki>
 
  <nowiki>bcopy [-zc] <&copy> <N> <&source> <S> <M></nowiki>
 
This copies M bytes from &source starting at position S to &copy starting at position N.
 
This copies M bytes from &source starting at position S to &copy starting at position N.

Revision as of 10:42, 29 September 2006

The bcopy command is used to copy a (part of a) binary file.

bcopy [-zc] <&copy> <N> <&source> <S> <M>

This copies M bytes from &source starting at position S to &copy starting at position N. If &copy doesn't exist yet, the binary file will be created and zero filled to the Nth byte. If &copy already exists but smaller then N bytes, it will be extended with zeros to the Nth byte. If &copy already exists and is N bytes or larger, the copied bytes will overwrite the old bytes in &copy. If &source is smaller then S + M - 1 bytes and &source is equal or larger then S bytes, then all bytes starting from S to the last byte will be copied. If &source is smaller then S bytes, you will get an error. You can use M = -1 to copy all bytes starting from byte S to the last byte.

The -z switch will zero fill all bytes in &source that were copied. The -c switch will chop &copy to N + M bytes.