Skip to content

Commit 15689bc

Browse files
committed
Update example_process_1.f90
1 parent 56f02ab commit 15689bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

example/system/example_process_1.f90

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
! Process example 1: Run a Command Synchronously and Capture Output
22
program run_sync
3-
use stdlib_system, only: run, is_completed, process_type
3+
use stdlib_system, only: run, is_completed, is_windows, process_type
44
implicit none
55

66
type(process_type) :: p
77
logical :: completed
88

99
! Run a synchronous process to list directory contents
10-
p = run("ls -l", want_stdout=.true.)
10+
if (is_windows()) then
11+
p = run("dir", want_stdout=.true.)
12+
else
13+
p = run("ls -l", want_stdout=.true.)
14+
end if
1115

1216
! Check if the process is completed (should be true since wait=.true.)
1317
if (is_completed(p)) then

0 commit comments

Comments
 (0)