Copy files/directories.
leading and trailing white spaces are trimmed out.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
||
| character(len=*), | intent(in), | optional | :: | file_name | File name. |
|
| character(len=*), | intent(in), | optional | :: | dir_name | Dir name. |
subroutine cp(self, file_name, dir_name)
!< Copy files/directories.
!<
!< @note leading and trailing white spaces are trimmed out.
class(os_object), intent(inout) :: self !< OS.
character(*), intent(in), optional :: file_name !< File name.
character(*), intent(in), optional :: dir_name !< Dir name.
if (present(file_name)) then
call execute_command_line(command=self%cp_file_command//' '//trim(adjustl(file_name)), exitstat=self%error%status)
elseif (present(dir_name)) then
call execute_command_line(command=self%cp_dir_command//' '//trim(adjustl(dir_name)), exitstat=self%error%status)
else
self%error%status = ERROR_CP_FAILED
endif
endsubroutine cp