You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`args`: Shall be a `character(*)` string (for command-line execution) or a `character(*), dimension(:)` array (for argument-based execution). It specifies the command and arguments to execute. This is an `intent(in)` argument.
31
31
32
-
`wait` (optional): Shall be a `logical` flag. If `.true.` (default), the process will execute synchronously (blocking). If `.false.`, the process will execute asynchronously (non-blocking). This is an `intent(in)` argument.
32
+
`stdin` (optional): Shall be a `character(*)` value containing input to send to the process via standard input (pipe). This is an `intent(in)` argument.
33
+
34
+
`want_stdout` (optional): Shall be a `logical` flag. If `.true.`, the standard output of the process will be captured; if `.false.` (default), it will be lost. This is an `intent(in)` argument.
35
+
36
+
`want_stderr` (optional): Shall be a logical flag. If `.true.`, the standard error output of the process will be captured. Default: `.false.`. This is an `intent(in)` argument.
37
+
38
+
### Return Value
39
+
40
+
Returns an object of type `process_type` that contains information about the state of the created process.
41
+
42
+
### Example
43
+
44
+
```fortran
45
+
! Example usage with command line or list of arguments
46
+
type(process_type) :: p
47
+
48
+
! Run a simple command line synchronously
49
+
p = run("echo 'Hello, world!'", want_stdout=.true.)
50
+
```
51
+
52
+
53
+
## `runasync` - Execute an external process asynchronously
54
+
55
+
### Status
56
+
57
+
Experimental
58
+
59
+
### Description
60
+
61
+
The `runasync` interface allows execution of external processes using a single command string or a list of arguments.
62
+
Processes are run asynchronously (non-blocking), meaning execution does not wait for the process to finish.
63
+
Optional arguments enable the collection of standard output and error streams, as well as sending input via standard input.
`args`: Shall be a `character(*)` string (for command-line execution) or a `character(*), dimension(:)` array (for argument-based execution). It specifies the command and arguments to execute. This is an `intent(in)` argument.
33
72
34
73
`stdin` (optional): Shall be a `character(*)` value containing input to send to the process via standard input (pipe). This is an `intent(in)` argument.
35
74
@@ -47,11 +86,11 @@ Returns an object of type `process_type` that contains information about the sta
47
86
! Example usage with command line or list of arguments
0 commit comments