subroutinecopy_file
subroutine copy_file(from, to, stat)
Copy file from to to.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| from | character(len=*) | in | the file | |
| to | character(len=*) | in | the copy | |
| stat | integer | out | 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