apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tyler MacDonald <ty...@yi.org>
Subject apr_stat / apr_file_info_get misbehaving?
Date Tue, 16 May 2006 23:20:10 GMT
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?

	Thanks,
		Tyler


Mime
View raw message