Path: utzoo!utgpu!attcan!uunet!husc6!mailrus!cwjcc!hal!nic.MR.NET!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: SunOS 3.5 dd (ibs == obs) != bs Keywords: Bug or Feature Message-ID: <14463@mimsy.UUCP> Date: 10 Nov 88 11:47:56 GMT References: <37@eplrx7.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 25 In article <37@eplrx7.UUCP> mcneill@eplrx7.UUCP (mcneill) writes: >I looked at the System V source for dd and saw something like: > if (bs) ibs = obs = bs; >which leads me to believe that setting bs should do the same thing as >setting both ibs & obs. > >Does BSD do something different which makes this feature or did I miss >something in the source. You missed something in the source. (Caveat: I am guessing that the SV dd is based on the V7 dd.) There is a flag called `fflag' that is set by `bs=' but not by `ibs=' nor `obs='. fflag causes dd to use a `fast' loop, which preserves record boundaries on those files that have records (pipes, sockets, ttys, tapes): while ((n = read(...)) > 0) (void) write(..., n); while in other cases, dd completely fills its input buffer before copying to its output. Yes, the manual makes no attempt to explain this. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris