In working on the perl glue to apr, I've come across
a difference in finfo->protection on Win32 between
different versions of apr that I'm wondering if
someone can explain. I have this program:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
#ifdef __cplusplus
extern "C" {
#endif
#include <apr.h>
#include <apr_version.h>
#include <apr_portable.h>
#ifdef __cplusplus
}
#endif
int main(int argc, char **argv) {
apr_status_t rc;
apr_pool_t *p;
apr_finfo_t *finfo;
apr_int32_t wanted = APR_FINFO_NORM;
apr_fileperms_t protection;
const char fname[] = "C:/Apache2/include/apr_file_info.h";
rc = apr_app_initialize(&argc, &argv, NULL);
rc = apr_pool_create(&p, NULL);
finfo = (apr_finfo_t *) apr_pcalloc(p, sizeof(apr_finfo_t));
rc = apr_stat(finfo, fname, wanted, p);
protection = finfo->protection;
printf("protection: %d\n", protection);
printf("WREAD: %d\n", protection & APR_WREAD);
printf("WWRITE: %d\n", protection & APR_WWRITE);
return 0;
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
With version 0.9.7 of apr (Apache/2.0.55), I get:
protection: 1911
WREAD: 4
WWRITE: 2
while with version 1.2.7 of apr (Apache/2.2.2), I get:
protection: 1904
WREAD: 0
WWRITE: 0
I couldn't see what changed in apr/file_io/win32/filestat.c
to cause this difference - is this an intentional change?
Thanks.
--
best regards,
Randy Kobes