I have a need to pad a binary file with some character
(probably a null character) so that its total length
is a multiple of some number.  For example, I have a file
called kernel.debian, whose size is 6319616 bytes.  I need
to pad it with nulls until its length is a multiple of 80.
The next higher multiple of 80 is 6319680, which can be
obtained by padding the file with 64 null characters.
In CMS, the FBLOCK CMS Pipelines stage will do the trick.
For example,

   PIPE < KERNEL DEBIAN A1 | FBLOCK 80 00 | > KERNEL1 DEBIAN A1 F

This will create an output file with fixed-length 80-byte
records, padded as necessary at the end with null characters,
so that all records are exactly 80 bytes long.

I am looking for a way to do this padding in Linux.
A search of the internet using the keywords "pad file Linux"
did not seem to produce any useful results.  Does anyone know
how to accomplish this? 

-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/173555076.1944854.1372523652842.javamail.r...@md01.wow.synacor.com

Reply via email to