atomic_rename Subroutine

public subroutine atomic_rename(old_path, new_path, status)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: old_path
character(len=*), intent(in) :: new_path
integer, intent(out) :: status

Called by

proc~~atomic_rename~~CalledByGraph proc~atomic_rename atomic_rename proc~begin_checkpoint_publish begin_checkpoint_publish proc~begin_checkpoint_publish->proc~atomic_rename proc~generate_matching_plane_zhao_atlas generate_matching_plane_zhao_atlas proc~generate_matching_plane_zhao_atlas->proc~atomic_rename proc~generate_matching_plane_zhao_response_table generate_matching_plane_zhao_response_table proc~generate_matching_plane_zhao_response_table->proc~atomic_rename proc~maybe_write_periodic_checkpoint maybe_write_periodic_checkpoint proc~maybe_write_periodic_checkpoint->proc~atomic_rename proc~publish_checkpoint_manifest publish_checkpoint_manifest proc~maybe_write_periodic_checkpoint->proc~publish_checkpoint_manifest proc~write_checkpoint_state_files write_checkpoint_state_files proc~maybe_write_periodic_checkpoint->proc~write_checkpoint_state_files proc~publish_checkpoint_manifest->proc~atomic_rename proc~write_periodic_operator_cache write_periodic_operator_cache proc~write_periodic_operator_cache->proc~atomic_rename proc~precompute_periodic_root_operator precompute_periodic_root_operator proc~precompute_periodic_root_operator->proc~write_periodic_operator_cache proc~write_checkpoint_state_files->proc~begin_checkpoint_publish proc~write_result_files write_result_files proc~write_result_files->proc~begin_checkpoint_publish program~main main program~main->proc~publish_checkpoint_manifest program~main->proc~write_result_files program~zhao_atlas_main zhao_atlas_main program~zhao_atlas_main->proc~generate_matching_plane_zhao_atlas program~zhao_response_main zhao_response_main program~zhao_response_main->proc~generate_matching_plane_zhao_response_table proc~core_build_panel_plan_impl core_build_panel_plan_impl proc~core_build_panel_plan_impl->proc~precompute_periodic_root_operator proc~core_build_plan_impl core_build_plan_impl proc~core_build_plan_impl->proc~precompute_periodic_root_operator

Source Code

  subroutine atomic_rename(old_path, new_path, status)
    character(len=*), intent(in) :: old_path, new_path
    integer, intent(out) :: status
    character(kind=c_char), allocatable :: c_old_path(:), c_new_path(:)

    if (len_trim(old_path) == 0 .or. len_trim(new_path) == 0) then
      status = filesystem_empty_path
      return
    end if
    call to_c_string(trim(old_path), c_old_path)
    call to_c_string(trim(new_path), c_new_path)
    if (c_rename(c_old_path, c_new_path) == 0_c_int) then
      status = filesystem_success
    else
      status = filesystem_os_error
    end if
  end subroutine atomic_rename