off_os_object Module

module~~off_os_object~~UsesGraph module~off_os_object off_os_object module~off_error_object off_error_object module~off_error_object->module~off_os_object penf penf penf->module~off_os_object penf->module~off_error_object stringifor stringifor stringifor->module~off_os_object iso_fortran_env iso_fortran_env iso_fortran_env->module~off_error_object
Help

OFF OS object definition and implementation.

Used By

module~~off_os_object~~UsedByGraph module~off_os_object off_os_object module~off_simulation_object off_simulation_object module~off_os_object->module~off_simulation_object module~off_objects off_objects module~off_os_object->module~off_objects module~off_simulation_object->module~off_objects program~off_test_save_load_file_parameters off_test_save_load_file_parameters module~off_objects->program~off_test_save_load_file_parameters program~off_test_load_file_parameters off_test_load_file_parameters module~off_objects->program~off_test_load_file_parameters program~off_test_save_load_file_grid off_test_save_load_file_grid module~off_objects->program~off_test_save_load_file_grid
Help


Variables

TypeVisibility AttributesNameInitial
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.


Derived Types

type, public :: os_object

OS object class.

Components

TypeVisibility AttributesNameInitial
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.

Type-Bound Procedures

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.


Subroutines

private subroutine cp(self, file_name, dir_name)

Copy files/directories.

Arguments

Type IntentOptional AttributesName
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.

private elemental subroutine destroy(self)

Destroy OS… not your :-)

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: self

OS.

private elemental subroutine initialize(self, system)

Initialize OS.

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: self

OS.

character(len=*), intent(in), optional :: system

System name, valid [unix, windows].

private elemental subroutine initialize_unix(self)

Initialize OS as unix-like system.

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: self

OS.

private elemental subroutine initialize_windows(self)

Initialize OS as windows-like system.

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: self

OS.

private subroutine mkdir(self, dir_name)

Make directoriy.

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: self

OS.

character(len=*), intent(in) :: dir_name

Dir name.

private pure subroutine os_assign_os(lhs, rhs)

Operator =.

Arguments

Type IntentOptional AttributesName
class(os_object), intent(inout) :: lhs

Left hand side.

type(os_object), intent(in) :: rhs

Right hand side.

private subroutine rm(self, file_name, dir_name)

Remove files/directories.

Arguments

Type IntentOptional AttributesName
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.