fdoc

subroutinecopy_file

subroutine copy_file(from, to, stat)

Copy file from to to.

Arguments

NameTypeIntentAttributesDescription
fromcharacter(len=*)in

the file

tocharacter(len=*)in

the copy

statintegerout

nonzero on failure

Calls

Source

Show the code
subroutine copy_file(from, to, stat)
    character(len=*), intent(in) :: from    !! the file
    character(len=*), intent(in) :: to      !! the copy
    integer, intent(out) :: stat            !! nonzero on failure

    if (is_windows()) then
        call run_command('copy /y '//quoted_path(from)//' '//quoted_path(to)//' >nul', stat)
    else
        call run_command('cp '//quoted_path(from)//' '//quoted_path(to), stat)
    end if
end subroutine copy_file

Graphs

Calls

Called by