OFF OS object definition and implementation.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=I4P), | private, | parameter | :: | ERROR_CP_FAILED | = | 1 | Failed to copy files/directories. |
| integer(kind=I4P), | private, | parameter | :: | ERROR_FALLBACK_INIT | = | 4 | Failed to set custom OS, used fallback system (unix). |
| integer(kind=I4P), | private, | parameter | :: | ERROR_MKDIR_FAILED | = | 2 | Failed to create directory. |
| integer(kind=I4P), | private, | parameter | :: | ERROR_RM_FAILED | = | 3 | Failed to remove files/directories. |
| integer(kind=I4P), | private, | parameter | :: | NO_ERROR | = | 0 | No errors occurred. |
OS object class.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | cp_dir_command | Copy directory command. |
||
| character(len=:), | public, | allocatable | :: | cp_file_command | Copy file command. |
||
| type(error_object), | public | :: | error | Error handler. |
|||
| character(len=:), | public, | allocatable | :: | mkdir_command | Make directory command. |
||
| character(len=:), | public, | allocatable | :: | path_separator | Path seperator, e.g. "/" for unix-like systems. |
||
| character(len=:), | public, | allocatable | :: | rm_dir_command | Remove directory command. |
||
| character(len=:), | public, | allocatable | :: | rm_file_command | Remove file command. |
| generic, public :: assignment(=) => os_assign_os | Overload |
| procedure, public, pass(self) :: cp | Copy files/directories. |
| procedure, public, pass(self) :: destroy | Destroy OS… not your :-) |
| procedure, public, pass(self) :: initialize | Initialze OS. |
| procedure, public, pass(self) :: initialize_unix | Initialze OS as unix-like system. |
| procedure, public, pass(self) :: initialize_windows | Initialze OS as windows-like system. |
| procedure, public, pass(self) :: mkdir | Make directory. |
| procedure, public, pass(lhs) :: os_assign_os | Operator |
| procedure, public, pass(self) :: rm | Remove files/directories. |
Copy files/directories.
| 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. |
Destroy OS… not your :-)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
Initialize OS.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
||
| character(len=*), | intent(in), | optional | :: | system | System name, valid [unix, windows]. |
Initialize OS as unix-like system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
Initialize OS as windows-like system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
Make directoriy.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
||
| character(len=*), | intent(in) | :: | dir_name | Dir name. |