X-Spam-Check-By: sourceware.org Message-ID: <46569B8B.1C15A76E@dessent.net> Date: Fri, 25 May 2007 01:17:15 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: Peter Milne CC: cygwin AT cygwin DOT com Subject: Re: problem concating (>>) to a large file References: <001201c79ea3$4d82bce0$8500a8c0 AT RUSNAK> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Peter Milne wrote: > I have a large file, let's call it A. I want to stick the contents of a > small file (let's call it B) onto the end of A. > > Until recently in cygwin I could just type: > > cat B >> A > > and it did exactly what I wanted. > > Now though, presumably because A has gotten so large, when I do the above > command the contents of file B get copied onto the front of file A rather > than onto its end. > > I assume that A has become sufficiently large that a 64-bit file offset is > needed to properly address it and that >> doesn't currently support this. > If so this certainly seems like a short coming, perhaps even a bug. > > I updated my version of cygwin to the latest version but this didn't help. > > Is there a fix or workaround? I think there is a newlib bug (or maybe it's a Cygwin bug) where stdin/stdout start off opened in 32 bit mode. I'm not sure of the details, and all I know about it is from observing that Eric Blake has been working on compensating for this dilemma in gnulib as it seems to cause problems seeking in some circumstances. Anyway, you can achieve what you want with dd without the extra copy step and without using stdin/stdout redirection and with the extra bonus of being able to specify the Windows-optimal 64k block size (although since you said B is small it shouldn't matter much): dd if=B of=A bs=64k conv=notrunc oflag=append Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/