Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!husc6!wjh12!gst From: gst@wjh12.harvard.edu (Gary S. Trujillo) Newsgroups: comp.unix.questions Subject: Re: meaning of "count=" for dd? Summary: There ain't no easy answer! Message-ID: <420@wjh12.harvard.edu> Date: 24 Oct 89 17:47:04 GMT References: <419@wjh12.harvard.edu> Reply-To: gst@wjh12.UUCP (Gary S. Trujillo) Organization: Harvard University, Cambridge MA Lines: 28 In article <419@wjh12.harvard.edu> gst@wjh12.UUCP (Gary S. Trujillo) writes: >My empirical tests of dd leave me puzzled as to the real meaning of the >"count=" argument. The manual page says "copy only n input records." >Trouble is, it doesn't say what sort of "record" it's talking about. >I would have thought that it would be the number of characters in a >block, as defined by one of the blocksize (e.g., "bs") arguments. Thanks to everyone who sent email replies - including the AT&T person who has actually worked on the dd code(!). The upshot of the comments was that my problem may come from the fact (it is a fact) that I'm reading from a pipe in my application, and that a "record" (called "block" in other versions of the man page, apparently) corresponds to one physical read. Thus, the amount read may vary, depending on a number of factors. There was a suggestion that I try 512-byte blocks, since that's normally the size of a program buffer ("but it's not foolproof"). My tests indicate that suggestion seems to work. The AT&T guy also says that results vary between System V and BSD UNIX implementations, having to do with different implementations of the file system, I think: "Network files will usually break into 2K blocks, no matter what you ask for." Thanks again, and happy "dd-ing!" :-) -- Gary Trujillo (gst@wjh12.harvard.edu)