From mint-bounce@lists.fishpool.fi Sun Oct 24 23:14:54 2004 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de To: Mint List From: Peter Slegg Subject: Re: [MiNT] Getline X-Mailer: MyMAIL Rev:1.72-01.10346 (Atari/(STiK/STinG/GlueSTiK)) X-Hardware: Atari Milan MIME-Version: 1.0 Date: Sat, 24 Oct 2004 03:57:52 +0200 (GMT) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal Message-Id: <0037f5d5.019d368037c0@smtp.freeola.net> References: <1098650426.4497.2.camel@localhost> In-Reply-To: 1098650426.4497.2.camel@localhost X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: peterslegg@scubadivers.co.uk Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=2.0 tagged_above=-50.5 required=3.8 tests=AWL, BAYES_00, DATE_IN_PAST_12_24, FOR_FREE, MISSING_MIMEOLE, MISSING_OUTLOOK_NAME X-Spam-Level: ** Hi Mark, I am not a Mint programmer and don't know anything about getline so I hope I am not insulting your intelligence but sometimes errors like this occur when reading files with cr/lf instead of unix line endings. Just a thought. Regards, Peter On Sun, 24 Oct 2004 16:40:26 -0400, Mark Duckworth wrote: > > Hello everyone, > > I'm writing the new Sparemint Update Manager software. One of the > things this software must do is read in a package database which it does > one line at a time. > > For some reason, getline is producing very inconsistent results. > > I am using it as such: > > while ((getline(&line, &len, fp))!=-1) > { > // Do actions > count++; > } > > now the file that it's reading is 358 lines long. > > Sometimes it will read 242 lines of this file. Other times 301 lines of > this file. I have verified the value getline is returning is indeed -1 > for some reason before the end of the file which also indicates error. > But what error could I be getting? Regardless I simply cannot get it to > read the entire file! I'm not precisely sure what I'm doing wrong. Any > ideas? > > Thanks, > Mark > > > > ________________________________________________________________________ FREE local-rate dial-up - no monthly fees! Move over to Freeola for FREE unlimited web space, e-mail & domain hosting www.freeola.com