apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler MacDonald <ty...@yi.org>
Subject Re: apr_stat / apr_file_info_get misbehaving?
Date Tue, 16 May 2006 23:58:49 GMT
Davi Arnaut <davi@haxent.com.br> 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/..) ?

	Debian GNU/Linux.

$ ldd /usr/lib/libapr-0.so
        linux-gate.so.1 =>  (0xffffe000)
        libdb-4.3.so => /usr/lib/libdb-4.3.so (0xa7e49000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0xa7e28000)
        librt.so.1 => /lib/tls/librt.so.1 (0xa7e20000)
        libm.so.6 => /lib/tls/libm.so.6 (0xa7dfa000)
        libcrypt.so.1 => /lib/tls/libcrypt.so.1 (0xa7dcc000)
        libnsl.so.1 => /lib/tls/libnsl.so.1 (0xa7db6000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xa7da4000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0xa7d9f000)
        libc.so.6 => /lib/tls/libc.so.6 (0xa7c67000)
        /lib/ld-linux.so.2 (0x75555000)

	Thanks,
		Tyler


Mime
View raw message