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 Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Herb Martin" To: "'Cygwin List'" Subject: RE: stat file -- cygwin vs. Windows size? Date: Fri, 24 Jun 2005 14:20:20 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit In-Reply-To: <6.2.1.2.0.20050624141431.06359818@pop.prospeed.net> X-Spam-Flag: NO X-Spam-DCC: : X-Spam-Pyzor: Reported 0 times. Message-ID: <20626ACD2AB9@mail.learnquick.com> > >Is there a standard Cygwin 'idiom' or function for dealing with this > >mismatch, or should I just re-invent the wheel. > > > If you actually believe that you want the file without cr/nl > conversion during a read, then you want to open it in binary > mode (fopen() with "rb" > instead of "r" or open() with '| O_BINARY' appended). This > *may* be the solution in this case. Since the default mode > for opening files is always "text" but there is no difference > in format/behavior between "text" and "binary" on UNIX/Linux, > you wouldn't see an issue there. Actually I am between a rock and hard place -- email server on one side and SpamD on the other. Apparently the SpamD 'protocol' requires passing the size to SpamD. I don't want to start re-writing code all over either program -- I just want to talk the source email system into telling spamd whatever it needs to know to be happy. Currently, I am accumulating bytes, and will use that, but I am missing something and not getting the write count (YET.) -- 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/