delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/24/15:40:49

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 24 Jun 2005 15:40:23 -0400 (EDT)
From: Jason Pyeron <jpyeron AT pdinc DOT us>
To: cygwin AT cygwin DOT com
Subject: RE: stat file -- cygwin vs. Windows size?
In-Reply-To: <20626ACD2AB9@mail.learnquick.com>
Message-ID: <Pine.LNX.4.62.0506241538260.31489@ns.pyerotechnics.com>
References: <20626ACD2AB9 AT mail DOT learnquick DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes

The binary size is accurate, text, by its nature may never be correct on 
any operating system, since it is buffered, parsed, etc by the OS in an OS 
dependent way.

If you use a binary mode then you will be fine.


On Fri, 24 Jun 2005, Herb Martin wrote:

>>> 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/
>

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-                                                               -
- Jason Pyeron                      PD Inc. http://www.pdinc.us -
- Partner & Sr. Manager             7 West 24th Street #100     -
- +1 (410) 808-6646 (c)             Baltimore, Maryland 21218   -
-                                                               -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain 
privileged, proprietary, or otherwise private information. If you 
have received it in error, purge the message from your system and 
notify the sender immediately.  Any other use of the email by you 
is prohibited.

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019