How do I pad files in Linux?

2013-06-29 Thread Stephen Powell
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

Re: How do I pad files in Linux?

2013-06-29 Thread Tixy
On Sat, 2013-06-29 at 12:34 -0400, Stephen Powell wrote: > 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

Re: How do I pad files in Linux?

2013-06-29 Thread Stan Hoeppner
On 6/29/2013 11:34 AM, Stephen Powell wrote: > 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 null

Re: How do I pad files in Linux?

2013-06-29 Thread Stan Hoeppner
On 6/29/2013 12:19 PM, Tixy wrote: > On Sat, 2013-06-29 at 12:34 -0400, Stephen Powell wrote: >> 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

Re: How do I pad files in Linux?

2013-06-29 Thread Stephen Powell
On Sat, 29 Jun 2013 14:23:51 -0400 (EDT), Stan Hoeppner wrote: > On 6/29/2013 12:19 PM, Tixy wrote: >> >> truncate -s %80 FILENAME >> >> Will pad with zero's to round size up to a multiple of 80. > > That'll teach me to read all posts before replying. Question: > > Does this append ASCII zeros

Re: How do I pad files in Linux?

2013-07-01 Thread Urs Thuermann
Stan Hoeppner writes: > One possibility might be > > ~$ cat file1 file2 >> file3 > > where file1 is your binary and file2 contains 64 nulls. Now you simply > need to create a file containing exactly 64 nulls. I've never screwed > with this, but I'd guess it can be done with one of the scripti

Re: How do I pad files in Linux?

2013-07-04 Thread Stephen Powell
On Mon, 01 Jul 2013 02:59:40 -0400 (EDT), Urs Thuermann wrote: > > dd if=/dev/zero bs=1 count=64 >> file Thanks, Urs. I haven't tried this, but it looks like this should work too. -- .''`. Stephen Powell : :' : `. `'` `- -- To UNSUBSCRIBE, email to debian-user-requ...@lists.

Re: How do I pad files in Linux? (SOLVED)

2013-06-29 Thread Stephen Powell
On Sat, 29 Jun 2013 13:19:22 -0400 (EDT), Tixy wrote: > > On Sat, 2013-06-29 at 12:34 -0400, Stephen Powell wrote: >> >> 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 >> c