[UP]


Manual Reference Pages  - process_close (3)

NAME

process_close(3fm) - [M_process] close a process being written to or read from (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Examples
See Also
Author
License

SYNOPSIS

subroutine process_close(fp,ierr)

      type(streampointer) :: fp
      integer             :: ierr

DESCRIPTION

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.

OPTIONS

fp C file pointer returned by process_open_*()
ierr error flag returned.

EXAMPLES

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_close

Sample output:

    CLOSE   : process is opened with status            0
    CLOSE   : process closed with status           13

SEE ALSO

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)

AUTHOR

John S. Urban

LICENSE

Public Domain


process_close (3) March 11, 2021
Generated by manServer 1.08 from ef7348d8-eeb2-40b4-b022-68b6940b67e5 using man macros.