Hi all. I want write Apache module with c, which in Lifecycle can create a file. How can i do it? Thanks for attention
why this work. static void *create_my_dir_config(pool *p, char *d) { fopen( "my_file", "a" ); ********** } module MODULE_VAR_EXPORT my_module = { STANDARD_MODULE_STUFF, NULL, /* initializer */ create_my_dir_config, /* dir config creator */ NULL, /* dir config merger */ NULL, /* server config creator */ NULL, /* server config merger */ NULL, /* command table */ NULL, /* handlers */ NULL, /* filename translation */ NULL, /* check_user_id */ NULL, /* check auth */ NULL, /* check access */ NULL, /* type_checker */ NULL, /* fixups */ NULL, /* logger */ NULL, /* header parser */ NULL, /* child_init */ NULL, /* child_exit */ NULL /* post read-request */ }; /////////////////////////////////// but this dont work. static int my_translation(request_rec *r) { fopen( "my_file", "a" ); ************ return OK; } module MODULE_VAR_EXPORT my_module = { STANDARD_MODULE_STUFF, NULL, /* initializer */ NULL, /* dir config creator */ NULL, /* dir config merger */ NULL, /* server config creator */ NULL, /* server config merger */ NULL, /* command table */ NULL, /* handlers */ my_translation, /* filename translation */ NULL, /* check_user_id */ NULL, /* check auth */ NULL, /* check access */ NULL, /* type_checker */ NULL, /* fixups */ NULL, /* logger */ NULL, /* header parser */ NULL, /* child_init */ NULL, /* child_exit */ NULL /* post read-request */ }; /////////////////////////// in a first example file was created, but in second example wasn't created?