2 * ========================================================================
3 * Copyright 2006 University of Washington
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * ========================================================================
16 #include "../estruct.h"
22 * P_open - run the given command in a sub-shell returning a file pointer
23 * from which to read the output
26 * For OS's other than unix, you will have to rewrite this function.
27 * Hopefully it'll be easy to exec the command into a temporary file,
28 * and return a file pointer to that opened file or something.
34 extern FIOINFO g_pico_fio
;
36 g_pico_fio
.flags
= FIOINFO_READ
;
37 g_pico_fio
.name
= "pipe";
39 if((g_pico_fio
.fp
= popen(s
, "r")) != NULL
)
44 /* Windows never did this, but piping has been done elsewhere */
52 * P_close - close the given descriptor
59 extern FIOINFO g_pico_fio
;
62 (void) pclose(g_pico_fio
.fp
);