process_close(3fm) - [M_process] close a process being written to or read from (LICENSE:PD)
Synopsis
Description
Options
Examples
See Also
Author
License
subroutine process_close(fp,ierr)
type(streampointer) :: fp integer :: ierr
The M_process Fortran procedures use the ISO_C_BINDING interface to define Fortran-callable versions of the C procedures popen(3c)/pclose(3c) and fgets(3c)/fputs(3c). A set of record-oriented wrapper routines are then used to create a simple Fortran-callable interface.A POSIX C interface is generally available but may require using a Linux subwindow or an application such as CygWin on MSWindows platforms.
See "M_process" for an extended description.
fp C file pointer returned by process_open_*() ierr error flag returned.
This example shows a simple open and close of a process
program demo_process_close use M_process ,ONLY: process_open_read, process_open_write use M_process ,ONLY: streampointer, process_close implicit none type(streampointer) :: fp integer :: ierr ! open process to read from call process_open_read(ls -l,fp,ierr) write(*,*)CLOSE : process is opened with status ,ierr call process_close(fp,ierr) write(*,*)CLOSE : process closed with status ,ierr end program demo_process_closeSample output:
CLOSE : process is opened with status 0 CLOSE : process closed with status 13
o PIPES: pipe(3c), popen(3c), pclose(3c), fflush(3c) o NAMED PIPES: mkfifo(3c), mknod(3c) o SUBPROCESSES: fork(3c) o OTHER: fflush(3c)
John S. Urban
Public Domain
Nemo Release 3.1 | process_close (3) | February 23, 2025 |