(bind-func sys_file_mktemp
(lambda (filename_prefix pool)
(letz ((file:apr_file_t** (zalloc))
(namebuf:i8* (zalloc 1024))
(res APR_SUCCESS))
(sprintf namebuf "%sXXXXXX" (cstring filename_prefix))
(set! res (apr_file_mktemp file namebuf 0 pool))
(if (= res APR_SUCCESS) (pref file 0) null))))