OS object class.
This class is designed as an helper for performing system calls, e.g. make directory, copy files, etc…
| 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. |
Overload =.
Operator =.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | lhs | Left hand side. |
||
| type(os_object), | intent(in) | :: | rhs | Right hand side. |
Copy files/directories.
Destroy OS… not your :-)
Initialze 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]. |
Initialze OS as unix-like system.
Initialize OS as unix-like system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
Initialze OS as windows-like system.
Initialize OS as windows-like system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | self | OS. |
Make directory.
Operator =.
Operator =.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(os_object), | intent(inout) | :: | lhs | Left hand side. |
||
| type(os_object), | intent(in) | :: | rhs | Right hand side. |
Remove files/directories.
type :: os_object
!< OS object class.
!<
!< This class is designed as an helper for performing system calls, e.g. make directory, copy files, etc...
type(error_object) :: error !< Error handler.
character(len=:), allocatable :: path_separator !< Path seperator, e.g. "/" for unix-like systems.
character(len=:), allocatable :: cp_dir_command !< Copy directory command.
character(len=:), allocatable :: cp_file_command !< Copy file command.
character(len=:), allocatable :: mkdir_command !< Make directory command.
character(len=:), allocatable :: rm_dir_command !< Remove directory command.
character(len=:), allocatable :: rm_file_command !< Remove file command.
contains
! public methods
procedure, pass(self) :: cp !< Copy files/directories.
procedure, pass(self) :: destroy !< Destroy OS... not your :-)
procedure, pass(self) :: initialize !< Initialze OS.
procedure, pass(self) :: mkdir !< Make directory.
procedure, pass(self) :: rm !< Remove files/directories.
! operators
generic :: assignment(=) => os_assign_os !< Overload `=`.
! private methods
procedure, pass(self) :: initialize_unix !< Initialze OS as unix-like system.
procedure, pass(self) :: initialize_windows !< Initialze OS as windows-like system.
procedure, pass(lhs) :: os_assign_os !< Operator `=`.
endtype os_object