(bind-func sys_ls
(lambda (dirname)
(letz ((pool (apr_pool_create))
(dir:i8** (zalloc))
(info:apr_finfo_t* (zalloc))
(res APR_SUCCESS)
(file_list (list)))
(apr_dir_open dir (cstring dirname) pool)
(while (= (apr_dir_read info APR_FINFO_NAME (pref dir 0)) 0)
(set! file_list (cons (Str (tref info 15)) file_list)))
(apr_dir_close (pref dir 0))
(apr_pool_destroy pool)
file_list)))