GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
RLE_OPEN_F(3) FreeBSD Library Functions Manual RLE_OPEN_F(3)

rle_open_f - Open a binary file for input or output with defaults.
rle_open_f_noexit - Returns error code instead of exiting.

FILE *rle_open_f( prog_name, file_name, mode )
char *prog_name, *file_name, *mode;

FILE *rle_open_f_noexit( prog_name, file_name, mode )
char *prog_name, *file_name, *mode;

The function rle_open_f is provided to simplify the task of opening files in toolkit programs. It works similarly to fopen(3), but it also provides error checking and messages, and default values for input and output. If the specified file_name cannot be opened, an error message is printed and the program exits. A variant rle_open_f_noexit is provided which will return NULL if the file cannot be opened. An error message is still printed.

On those systems which require it, a 'b' will be appended to the mode string so that the file will be opened in binary mode.

If the file_name is NULL or "-", then stdin will be returned for input (mode "r") files and stdout will be returned for output (mode "w" or "a") files.

The following two options are available only on systems supporting pipes. If the file_name starts with a "|" character, then the rest of the file name will be taken as a sh(1) command. If mode is "r", a pipe from the output of the sh command will be returned. If mode is "w" or "a", a pipe to the input of the sh command will be returned.

If the file_name ends with the suffix ".Z" (and does not start with "|"), then the compress(1) program will be invoked to uncompress (mode "r") or compress (mode "w" or "a") the file. The file descriptor returned by rle_open_f will be a pipe from or to the compress program.

fopen(3), popen(3), compress(1).

Gerald Winter
Spencer W. Thomas
University of Michigan

If the command invoked via popen does not exist, the popen still returns successfully, and the underlying sh prints an error message.

There is no way of telling that a particular FILE pointer has been created by popen, so it isn't possible to cleanly close the pipe with pclose. In fact, the eventual output file may not even exist by the time the program exits.

2/2/87 4th Berkeley Distribution

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.