apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davi Arnaut <d...@haxent.com.br>
Subject Re: apr_stat / apr_file_info_get misbehaving?
Date Tue, 16 May 2006 23:54:05 GMT
On Tue, 16 May 2006 16:20:10 -0700
Tyler MacDonald <tyler@yi.org> 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));
> 
>     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);
>     
>     stat(path, &sinfo);
>     
>     printf("stat: file is %llu bytes\n", sinfo.st_size);
> 
> 
> 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?
> 

Platform (win32/linux/..) ?

--
Davi Arnaut

Mime
View raw message