diff --git a/src/stdlib_system.F90 b/src/stdlib_system.F90 index c4c3d78d0..6f7d1b6e0 100644 --- a/src/stdlib_system.F90 +++ b/src/stdlib_system.F90 @@ -77,7 +77,7 @@ module stdlib_system !! - `process_open_cmd`: Opens a process using a command string. !! - `process_open_args`: Opens a process using an array of arguments. !! - module type(process_type) function process_open_cmd(cmd, wait, stdin, want_stdout, want_stderr) result(process) + module function process_open_cmd(cmd, wait, stdin, want_stdout, want_stderr) result(process) !> The command line string to execute. character(*), intent(in) :: cmd !> Optional input sent to the process via standard input (stdin). @@ -88,9 +88,11 @@ module type(process_type) function process_open_cmd(cmd, wait, stdin, want_stdou logical, optional, intent(in) :: want_stdout !> Whether to collect standard error output. logical, optional, intent(in) :: want_stderr + !> The output process handler. + type(process_type) :: process end function process_open_cmd - module type(process_type) function process_open_args(args, wait, stdin, want_stdout, want_stderr) result(process) + module function process_open_args(args, wait, stdin, want_stdout, want_stderr) result(process) !> List of arguments for the process to execute. character(*), intent(in) :: args(:) !> Optional input sent to the process via standard input (stdin). @@ -101,6 +103,8 @@ module type(process_type) function process_open_args(args, wait, stdin, want_std logical, optional, intent(in) :: want_stdout !> Whether to collect standard error output. logical, optional, intent(in) :: want_stderr + !> The output process handler. + type(process_type) :: process end function process_open_args end interface run diff --git a/src/stdlib_system_subprocess.F90 b/src/stdlib_system_subprocess.F90 index 5d815ef77..e57c073a2 100644 --- a/src/stdlib_system_subprocess.F90 +++ b/src/stdlib_system_subprocess.F90 @@ -82,7 +82,7 @@ module subroutine sleep(millisec) end subroutine sleep !> Open a new process - module type(process_type) function process_open_cmd(cmd,wait,stdin,want_stdout,want_stderr) result(process) + module function process_open_cmd(cmd,wait,stdin,want_stdout,want_stderr) result(process) !> The command and arguments character(*), intent(in) :: cmd !> Optional character input to be sent to the process via pipe @@ -91,13 +91,15 @@ module type(process_type) function process_open_cmd(cmd,wait,stdin,want_stdout,w logical, optional, intent(in) :: wait !> Require collecting output logical, optional, intent(in) :: want_stdout, want_stderr + !> The output process handler + type(process_type) :: process process = process_open_args([cmd],wait,stdin,want_stdout,want_stderr) end function process_open_cmd !> Open a new process - module type(process_type) function process_open_args(args,wait,stdin,want_stdout,want_stderr) result(process) + module function process_open_args(args,wait,stdin,want_stdout,want_stderr) result(process) !> The command and arguments character(*), intent(in) :: args(:) !> Optional character input to be sent to the process via pipe @@ -106,6 +108,8 @@ module type(process_type) function process_open_args(args,wait,stdin,want_stdout logical, optional, intent(in) :: wait !> Require collecting output logical, optional, intent(in) :: want_stdout, want_stderr + !> The output process handler + type(process_type) :: process real(RTICKS) :: count_rate logical :: asynchronous, collect_stdout, collect_stderr, has_stdin