writing (large) *fixed-length* files (to tape) using 'dd', et al

writing (large) *fixed-length* files (to tape) using 'dd', et al

Post by Tim Hoogasian, Senior Network Adm » Thu, 04 Mar 1993 10:14:46



Hi,

I need to be able to create pad out a variable-length file to a (larger)
fixed length when writing the file to tape.  (To answer the "why?" question
would require a _lengthy_ response.)  For argument's sake, I want to be
able to create a file of exactly 1Mb (1024Kb).

The following sequence (on a Sun) will work:

# create the padding
$ dd if=/dev/zero of=1MbFile bs=100k count=10  (or, of course, bs=1000k, count=1)

# pad out the original file to a bit over 1 Mb
$ cat {orig-file} 1MbFile > tempfile

# write the larger file out to tape
$ dd if=tempfile of=/dev/{tapedevice} bs=100k count=10

Problem: the file /dev/zero is not universal.  It shows up on our Suns and on the
RS/6000, but not on our HP's or DEC's.  (/dev/zero just gives you a stream of
nulls as long as you "read" from it - like the way /dev/null never "fills up".)

Is there a platform independent way of doing what /dev/zero does?  Or at any
rate, what I *want* to do, rather than just the implementation-specific details?

Thanks,

-Tim

---
==========================================================================
#define DISCLAIMER "I don't even represent myself, much less anyone else!"

==========================================================================

 
 
 

1. 'You're still guilty,' judge in Sun et al antitrust case tells MS

http://www.theregister.co.uk/content/4/27935.html

'US District Judge J Frederick Motz has rejected a Microsoft attempt
 to ? effectively ? have a string of prior convictions expunged from
 its record. Yesterday the Maryland judge denied a request by Microsoft
 attorneys to re-open 395 of Judge Penfield Jackson's 412 findings of
 fact, so for the moment at least Jackson's conclusions can be used in
 the case Motz is dealing with.'

2. current version of joe?

3. Extracting domain name on Sun's using gethostbyname et al

4. Problems compiling ppp-2.1.2c

5. KSH93: keybinding '\E[1~' (et al.)?

6. where can i find a free doc about as86 syntax on internet?

7. will linux work with 'Drive Manager' et al. ?

8. I need a libX11.so.3

9. ANN: 'twander' 2.34 Released For FreeBSD et al

10. KSH93 (Linux): keybinding '\E[1~' (et al.)?

11. how to edit a very large file using 'vi'

12. Reading a file as it's written (a al tail -f)

13. Microsoft's Cynical Adherence to Standards (Java et al)