Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
X-Apparently-From: <earnie?boyd@yahoo.com>
Message-ID: <3A6D0905.69D2FC03@yahoo.com>
Date: Mon, 22 Jan 2001 23:31:01 -0500
From: Earnie Boyd <earnie_boyd@yahoo.com>
Reply-To: cygwin <cygwin@cygwin.com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.171 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: problems with read()
References: <v04210106b692974bf0a1@[64.13.5.209]> <20010122221641.A14269@redhat.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Christopher Faylor wrote:

> On Mon, Jan 22, 2001 at 09:34:40PM -0500, David Johnson wrote:
> >I'm seeing weird problems with read()
> >
> >Below is a simple program that open()'s a file and read()'s 4K at a
> >time until the entire file is read.  Opening the file with different
> >paths seems to produce the problem while other paths have no problem.
> >
> >The first read to the file returns 20-40 bytes of the file and then
> >each read after that returns 0 bytes of the file.
>
> Open the file with the O_BINARY option:
>
> fd = open(filename, O_RDONLY | O_BINARY);

Changing the file to UNIX format would also help.  I.E.: Remove the \r
from the line endings.

Cheers,
Earnie.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

