1 #if !defined(lint) && !defined(DOS)
2 static char rcsid
[] = "$Id: popen.c 761 2007-10-23 22:35:18Z hubert@u.washington.edu $";
6 * ========================================================================
7 * Copyright 2006 University of Washington
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * ========================================================================
20 #include "../estruct.h"
26 * P_open - run the given command in a sub-shell returning a file pointer
27 * from which to read the output
30 * For OS's other than unix, you will have to rewrite this function.
31 * Hopefully it'll be easy to exec the command into a temporary file,
32 * and return a file pointer to that opened file or something.
38 extern FIOINFO g_pico_fio
;
40 g_pico_fio
.flags
= FIOINFO_READ
;
41 g_pico_fio
.name
= "pipe";
43 if((g_pico_fio
.fp
= popen(s
, "r")) != NULL
)
48 /* Windows never did this, but piping has been done elsewhere */
56 * P_close - close the given descriptor
63 extern FIOINFO g_pico_fio
;
66 (void) pclose(g_pico_fio
.fp
);