sopen(3) — UNIX Programmer’s Manual
NAME
sopen, sclose, isapipe
SYNOPSIS
#include <text/text.h>
DESCRIPTION
These functions operate on streams opened on files or pipes. They are part of the text library, libtext. The link editor searches this library under the "-ltext" option. Declarations for these functions may be obtained from the master include file <text/text.h>.
SUMMARY
FILE ∗ sopen(char ∗name, char ∗mode);
Opens name, which is either a file or a pipe, in the given mode. Returns a pointer to the opened stream, or zero in the event of an error. If name begins with a vertical bar, |, it is taken to be a pipe, and popen() is used. Otherwise it is taken to be a file, and fopen() is used. If mode is zero, "r" is used as a default. The stream returned by fBsopen should be closed using sclose().
void sclose(FILE ∗f);
Closes f, which is a stream opened with sopen().
int isapipe(int fd);
True if fd is a pipe, not a plain file. Note that fd is a file descriptor as returned by open(2), not a FILE pointer.
SEE ALSO
text(3), popen(3), fopen(3s), open(2)
NeXT, Inc. — July 7, 1989