From dev-return-16367-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Wed May 17 00:08:51 2006 Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 67895 invoked from network); 17 May 2006 00:08:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 May 2006 00:08:41 -0000 Received: (qmail 52387 invoked by uid 500); 17 May 2006 00:08:36 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 52352 invoked by uid 500); 17 May 2006 00:08:36 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 52340 invoked by uid 99); 17 May 2006 00:08:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 17:08:36 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [207.155.252.112] (HELO leander.cnchost.com) (207.155.252.112) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 May 2006 17:08:34 -0700 Received: from [192.168.0.21] (c-24-15-193-17.hsd1.il.comcast.net [24.15.193.17]) by leander.cnchost.com (ConcentricHost(2.54) Relay) with ESMTP id DECB53D93; Tue, 16 May 2006 20:08:13 -0400 (EDT) Message-ID: <446A696D.3000907@rowe-clan.net> Date: Tue, 16 May 2006 19:08:13 -0500 From: "William A. Rowe, Jr." User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tyler MacDonald CC: dev@apr.apache.org Subject: Re: apr_stat / apr_file_info_get misbehaving? References: <20060516232009.GH14382@yi.org> In-Reply-To: <20060516232009.GH14382@yi.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Tyler MacDonald wrote: > I'm getting this output: > > APR: file is 0 bytes > stat: file is 21296 bytes > > From this code: > > bzero(&finfo, sizeof(finfo)); > bzero(&sinfo, sizeof(sinfo)); First, assure us finfo is an apr_fileinfo_t and not a unixish finfo_t? > if((rv = apr_stat(&finfo, path, APR_FINFO_NORM, p)) != APR_SUCCESS) { > fprintf(stderr, "Failed to retrieve file information for %s\n", path); > return NULL; > } > > printf("APR: file is %lu bytes\n", finfo.size); You might be interested in APR_OFF_T_FMT (I think that's the name) Are you sure apr_off_t fits in %lu in your ./configure'ation? > Even if I change APR_FINFO_NORM to APR_FINFO_SIZE, or even open the file > first and use apr_file_info_get, APR always returns "size" as zero. Does > anybody know what could cause this? Uhm - need to tell us if finfo.valid & APR_FINFO_SIZE is set or not. _NORM includes _SIZE fwiw. Bill