Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <4.3.1.2.20020214092310.01eba7c0@pop.ma.ultranet.com> X-Sender: lhall AT pop DOT ma DOT ultranet DOT com X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Date: Thu, 14 Feb 2002 09:29:48 -0500 To: Pierre Muller , cygwin AT cygwin DOT com From: "Larry Hall (RFK Partners, Inc)" Subject: Re: [BUG] Patch.exe problem report In-Reply-To: <4.2.0.58.20020214133209.019b68a8@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 07:46 AM 2/14/2002, Pierre Muller wrote: >I already mentioned the following bug some time ago, >but I now took the time to identify the problem. > > > The problem appears if you are using patch to >apply a patch on a binary mounted device >while your patch uses a temporary directory that is located on >a text mounted dir. > >The temprary file is that created as >/temp/dir/ poXXXXX >where the XXX are replaced by a number. >But the file is opened without O_BINARY flag. > >After the patch is applied, the patch code tries to move the file, >which fails with EXDEV err, which seems OK as they are on different partition, >but after that the use copy_file function, >which does copy the file using O_BINARY file. > > This results in a unix mode source file on which you apply >a unix mode patch, will be written as text in the temporary directory, and thus >in Dos mode with CR/LF, and finally copied back to the binary mounted >dir. > > I hope that my explanation of the problem is clear enough. > >It seems to be a consequence of the apparently innocent assumption >that on a given OS, a copy of a text file from one dir to another dir can be done >using O_BINARY. But this assumption is false for cygwin. > >I didn't really find a good solution to this problem yet... Actually, this has been discussed before in the context of /cygdrive, which by default (along with network/UNC paths) is text mode. The /cygdrive issue can be resolved by remounting it as binary (i.e. "mount -b -f -c /cygdrive"). Network paths can be handled similarly, by mounting them explicitly. Sorry. There's no transparent option that works to everyone's liking. Everyone say "Thank you, Bill". Larry Hall lhall AT rfk DOT com RFK Partners, Inc. http://www.rfk.com 838 Washington Street (508) 893-9779 - RFK Office Holliston, MA 01746 (508) 893-9889 - FAX -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/