From dev-return-9199-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Thu Feb 13 10:24:11 2003 Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 72120 invoked by uid 500); 13 Feb 2003 10:24:10 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 72084 invoked from network); 13 Feb 2003 10:24:08 -0000 From: "Brian Havard" To: "=?iso-8859-1?q?Branko_=C4_ibej?=" Cc: "APR developers" Date: Thu, 13 Feb 2003 21:24:10 +1000 (EST) Reply-To: "Brian Havard" Priority: Normal X-Mailer: PMMail 2.20.2382 for OS/2 Warp 4.5 In-Reply-To: <3E4972CC.60305@xbc.nu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: cvs commit: apr/test testfileinfo.c Message-Id: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Tue, 11 Feb 2003 23:01:48 +0100, Branko =C4 ibej wrote: >Joe Orton wrote: >>--- filestat.c 7 Jan 2003 00:52:53 -0000 1.64 >>+++ filestat.c 11 Feb 2003 18:19:12 -0000 >>@@ -135,6 +135,8 @@ >> finfo->pool =3D thefile->pool; >> finfo->fname =3D thefile->fname; >> fill_out_finfo(finfo, &info, wanted); >>+ if (thefile->buffered) >>+ finfo->size +=3D thefile->bufpos; >> return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCES= S; >> } >> else { >> >> > >Hmm, does this patch actually work? I suspect the calculation would be >slightly more involved -- after all, the buffer might not extend past >the hard end-of-file at all. And the buffer might contain read data, not written. This is the patch I= 'm considering for the OS/2 code, it passes the File Info test: Index: filestat.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/cvs/apr/file_io/os2/filestat.c,v retrieving revision 1.34 diff -u -r1.34 filestat.c --- filestat.c 7 Jan 2003 00:52:51 -0000 1.34 +++ filestat.c 13 Feb 2003 10:20:08 -0000 @@ -141,6 +141,12 @@ if (finfo->filetype =3D=3D APR_REG) { if (thefile->isopen) { + if (thefile->buffered && thefile->direction =3D=3D 1) {= + if (thefile->filePtr + thefile->bufpos > finfo->siz= e) { + finfo->size =3D thefile->filePtr + thefile->buf= pos; + } + } + return handle_type(&finfo->filetype, thefile->filedes);= } } else { -- _______________________________________________________________________= _______ | Brian Havard | "He is not the messiah! = | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of = Brian | -----------------------------------------------------------------------= -------