|
|
|
|
|
|
|
|
Structure for referencing files. |
|
|
|
|
|
|
|
|
00462 {
00463 switch_status_t status = apr_dir_close(thedir->dir_handle);
00464
00465 free(thedir);
00466 return status;
00467 }
|
|
||||||||||||||||
|
Create a new directory on the file system.
00426 {
00427 return apr_dir_make(path, perm, pool);
00428 }
|
|
||||||||||||||||
|
Creates a new directory on the file system, but behaves like 'mkdir -p'. Creates intermediate directories as required. No error will be reported if PATH already exists.
00431 {
00432 return apr_dir_make_recursive(path, perm, pool);
00433 }
|
|
||||||||||||||||
|
00470 {
00471 const char *fname = NULL;
00472 apr_int32_t finfo_flags = APR_FINFO_DIRENT | APR_FINFO_TYPE | APR_FINFO_NAME;
00473 const char *name;
00474
00475 while (apr_dir_read(&(thedir->finfo), finfo_flags, thedir->dir_handle) == SWITCH_STATUS_SUCCESS) {
00476
00477 if (thedir->finfo.filetype != APR_REG) {
00478 continue;
00479 }
00480
00481 if (!(name = thedir->finfo.fname)) {
00482 name = thedir->finfo.name;
00483 }
00484
00485 if (!name) {
00486 continue;
00487 }
00488
00489 if (name) {
00490 switch_copy_string(buf, name, len);
00491 fname = buf;
00492 break;
00493 } else {
00494 continue;
00495 }
00496 }
00497 return fname;
00498 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
00441 {
00442 switch_status_t status;
00443 switch_dir_t *dir = malloc(sizeof(*dir));
00444
00445 if (!dir) {
00446 *new_dir = NULL;
00447 return SWITCH_STATUS_FALSE;
00448 }
00449
00450 memset(dir, 0, sizeof(*dir));
00451 if ((status = apr_dir_open(&(dir->dir_handle), dirname, pool)) == APR_SUCCESS) {
00452 *new_dir = dir;
00453 } else {
00454 free(dir);
00455 *new_dir = NULL;
00456 }
00457
00458 return status;
00459 }
|
|
||||||||||||
|
00379 {
00380 apr_dir_t *dir_handle;
00381 switch_memory_pool_t *our_pool = NULL;
00382 switch_status_t status;
00383
00384 if (!pool) {
00385 switch_core_new_memory_pool(&our_pool);
00386 pool = our_pool;
00387 }
00388
00389 if ((status = apr_dir_open(&dir_handle, dirname, pool)) == APR_SUCCESS) {
00390 apr_dir_close(dir_handle);
00391 }
00392
00393 if (our_pool) {
00394 switch_core_destroy_memory_pool(&our_pool);
00395 }
00396
00397 return status;
00398 }
|
|
|
Close the specified file.
00328 {
00329 return apr_file_close(thefile);
00330 }
|
|
||||||||||||||||||||
|
00322 {
00323 return apr_file_copy(from_path, to_path, perms, pool);
00324 }
|
|
||||||||||||
|
00401 {
00402 int32_t wanted = APR_FINFO_TYPE;
00403 switch_memory_pool_t *our_pool = NULL;
00404 switch_status_t status = SWITCH_STATUS_FALSE;
00405 apr_finfo_t info = { 0 };
00406
00407 if (!pool) {
00408 switch_core_new_memory_pool(&our_pool);
00409 }
00410
00411 if (filename) {
00412 apr_stat(&info, filename, wanted, pool ? pool : our_pool);
00413 if (info.filetype != APR_NOFILE) {
00414 status = SWITCH_STATUS_SUCCESS;
00415 }
00416 }
00417
00418 if (our_pool) {
00419 switch_core_destroy_memory_pool(&our_pool);
00420 }
00421
00422 return status;
00423 }
|
|
|
00373 {
00374 struct apr_finfo_t finfo;
00375 return apr_file_info_get(&finfo, APR_FINFO_SIZE, thefile) == SWITCH_STATUS_SUCCESS ? (switch_size_t) finfo.size : 0;
00376 }
|
|
||||||||||||
|
00333 {
00334 return apr_file_lock(thefile, type);
00335 }
|
|
||||||||||||||||||||
|
00368 {
00369 return apr_file_mktemp(thefile, templ, flags, pool);
00370 }
|
|
||||||||||||||||||||||||
|
Open the specified file.
00305 {
00306 return apr_file_open(newf, fname, flag, perm, pool);
00307 }
|
|
||||||||||||||||
|
00358 {
00359 va_list ap;
00360 int ret;
00361 va_start(ap, format);
00362 ret = apr_file_printf(thefile, format, ap);
00363 va_end(ap);
00364 return ret;
00365 }
|
|
||||||||||||||||
|
Read data from the specified file.
00348 {
00349 return apr_file_read(thefile, buf, nbytes);
00350 }
|
|
||||||||||||
|
Delete the specified file.
00343 {
00344 return apr_file_remove(path, pool);
00345 }
|
|
||||||||||||||||
|
00338 {
00339 return apr_file_rename(from_path, to_path, pool);
00340 }
|
|
||||||||||||||||
|
00310 {
00311 apr_status_t rv;
00312 apr_off_t off = (apr_off_t) (*offset);
00313 rv = apr_file_seek(thefile, where, &off);
00314 *offset = (int64_t) off;
00315 return rv;
00316 }
|
|
||||||||||||||||
|
Write data to the specified file.
00353 {
00354 return apr_file_write(thefile, buf, nbytes);
00355 }
|
1.3.9.1