#pclose()

DESCRIPTION
    close an open process, returning TRUE if successful, and ERR if unsuccessful
SYNOPSIS
    #pclose(F)
ARGUMENTS
    F - a filehandle (process handle) (all caps)
EXAMPLES
outputproc(C, P)        // send all output from process (P) to communications
                        // channel (C)
                        // (C) is the comm channel (e.g., mail, syslog, print)
                        // (P) is the process (e.g., "=ll /tmp")
                        // sample use:  =outputproc(mail, "=ll /tmp")
                        if #popen(OUTPUTPROC, (P), "r")
                                while #read(OUTPUTPROC) > 0
                                        output (C) $rdlin
                                endwhile
                                do pclose(OUTPUTPROC)
                        fi
dutop(N, D)     // using du, show the top N files/subdirs in directory D
                // (N) is the number of displayed files/subdirs (e.g., 10)
                // (D) is the directory (e.g., /tmp); don't enclose with quotes
                output mail =newline
                if "(D)" eq "/"
                        do #popen(DU, "=dusk /\* | =sort +0nr | =head -n (N)", "r")
                else
                        do #popen(DU, "=dusk (D)/\* | =sort +0nr | =head -n (N)", "r")
                endif
                while #read(DU) > 0
                        output mail $readline
                endwhile
                do pclose(DU)
                output mail =newline
SEE ALSO
    #fopen()
    #fclose()
    #popen()
    #read()
    #write()

    Numerical Functions
    String Functions
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about
conditionally
including
files