delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/27/11:26:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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: Tue, 27 May 2003 11:25:42 -0400
From: Peter Davis <pfd AT pfdstudio DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Behavior of stat() changed from NT to Win2000/XP
Message-ID: <20030527152542.GB19036@bitstream.com>
References: <Xns93886A9CDC8F4pdworldstdcom AT 80 DOT 91 DOT 224 DOT 249> <Pine DOT GSO DOT 4 DOT 44 DOT 0305271114090 DOT 22807-100000 AT slinky DOT cs DOT nyu DOT edu>
Mime-Version: 1.0
In-Reply-To: <Pine.GSO.4.44.0305271114090.22807-100000@slinky.cs.nyu.edu>
User-Agent: Mutt/1.5.4i

On Tue, May 27, 2003 at 11:19:30AM -0400, Igor Pechtchanski wrote:
> On Tue, 27 May 2003, Peter Davis wrote:
> 
> > Corinna Vinschen <corinna-cygwin AT cygwin DOT com> wrote in news:20030526141311 DOT GK875 AT cygbert DOT vinschen DOT de:
> >
> > > On Mon, May 26, 2003 at 09:58:11AM -0400, Peter Davis wrote:
> > >> On Windows NT, the Cygwin stat function returns a non-zero value in
> > >> the st_size field when called on a directory.  However, in Windows
> > >> 2000 and Windows XP, this same function returns 0 for st_size for a
> > >> directory.  This change in behavior has broken some features of mutt,
> > >> and possible other programs as well.
> > >> [...]
> > >> Is there some Cygwin setting or configuration option that controls
> > >> this?
> > >
> > > That's Windows, actually.  This value is returned for directories
> > > by the FindFile routines.  Nothing we can do about it.  However, if
> > > mutt depends on the st_size of a directory, that's a problem in mutt.
> >
> > So this is a case where Cygwin fails to emulate *nix behavior.  I assume
> > it works correctly on various *nix implementations.  You may consider
> > that a Windows issue, but if the purpose of Cygwin is to provide a
> > porting environment, then that's a shortcoming of Cygwin.
> >
> > The mutt developers aren't particularly concerned with Cygwin or
> > Windows, so they don't regard this as an issue.  I don't see why this is
> > a mutt problem.  They assume that stat() works correctly.  I'm not sure
> > who's responsible for the Cygwin build of mutt, or for including it in
> > Cygwin at all, but that's something to be considered in the future.
> >
> > I'm guessing there's no problem with mbox mail folders, since they're
> > just ordinary files.  The problem comes in because maildir and MH
> > formats us directories as mail folders.
> >
> > BTW, if anyone knows how to build mutt under Cygwin, I'm *dying* to find
> > out.  I can work around the stat() problem, but I have not succeeded in
> > building a mutt for Cygwin that doesn't crash on opening certain
> > messages.
> >
> > Thanks,
> > -pd
> 
> The Single Unix Specification has this to say about the st_size field of
> the stat structure:
> 
>   off_t     st_size    file size in bytes (if file is a regular file)
>                                            ^^^^^^^^^^^^^^^^^^^^^^^^^
> This means, IMO, that the value for directories is unspecified, and a
> portable application cannot rely on it at all.

Ok, I stand corrected.  Thanks, Igor.  In fact, the mutt code seems to
do most of the size checking in code which can be conditionally
compiled or not.  For some reason, this particular test was not
conditionalized.

Thanks,

-pd


-- 
--------
                             Peter Davis
               Funny stuff at http://www.pfdstudio.com
                 The artwork formerly shown as prints
    List of resources for children's writers and illustrators at:
                  http://www.pfdstudio.com/cwrl.html

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