From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1137 invoked from network); 20 Oct 2000 08:41:39 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 20 Oct 2000 08:41:39 -0000 Received: (qmail 23438 invoked by alias); 20 Oct 2000 08:41:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13051 Received: (qmail 23431 invoked from network); 20 Oct 2000 08:41:34 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: text vs. binary file open on Cygwin Date: Fri, 20 Oct 2000 12:41:31 +0400 Message-ID: <000e01c03a71$8bbe8bd0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal Under cygwin (and MS in general) they are different. Binary mode reads/write files as is; text mode translates between internal LF and external CR-LF for line ends. Cygwin is using very elaborate scheme (at least, I like it) to allow both Unix and Windows environment to coexist. The description is on . Side effect of this implementation is, if you create file on binary-mounted directory, then move it to text-mounted one and read, you probably won't get expected results. As a rule of thumb (my own) - if you use binary file, use explicit O_BINARY; if you use text file - leave it to system (a.k.a. cygwin) to decide. Currently I see at least two places, where we must use binary: - wordcode files (creation and reading). Is it possible for these files to contain explicit NL and CR-NL? Casual tests did not show problems; still, files are obviously binary. - memory mapped files. We do not support mmap on Cygwin, but we emulate it. And mmap is supposed to give you exact content of the file. Side effect is, that $(>