explain_freopen_or_die(3) Library Functions Manual explain_freopen_or_die(3)NAME
explain_freopen_or_die - open file and report errors
SYNOPSIS
#include <libexplain/freopen.h>
void explain_freopen_or_die(const char *pathname, const char *flags, FILE *fp);
DESCRIPTION
The explain_freopen_or_die function is used to reopen a file via the freopen(3) system call. On failure it will print an explanation,
obtained from the linexplain_freopen(3) function, on the standard error stream and then exit.
This function is intended to be used in a fashion similar to the following example:
explain_freopen_or_die(pathname, flags, fp);
pathname
The pathname, exactly as to be passed to the freopen(3) system call.
flags The flags, exactly as to be passed to the freopen(3) system call.
fp The fp, exactly as to be passed to the freopen(3) system call.
Returns:
Only ever return on success. Never returns on failure.
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
AUTHOR
Written by Peter Miller <pmiller@opensource.org.au>
explain_freopen_or_die(3)
Check Out this Related Man Page
explain_mkdir_or_die(3) Library Functions Manual explain_mkdir_or_die(3)NAME
explain_mkdir_or_die - create a directory and report errors
SYNOPSIS
#include <libexplain/mkdir.h>
void explain_mkdir_or_die(const char *pathname);
DESCRIPTION
The explain_mkdir_or_die function is used to call the mkdir(2) system call. On failure an explanation will be printed to stderr, obtained
from explain_mkdir(3), and then the process terminates by calling exit(EXIT_FAILURE).
This function is intended to be used in a fashion similar to the following example:
explain_mkdir_or_die(pathname);
pathname
The pathname, exactly as to be passed to the mkdir(2) system call.
Returns:
This function only returns on success. On failure, prints an explanation and exits.
SEE ALSO mkdir(2)
create a directory
explain_mkdir(3)
explain mkdir(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_mkdir_or_die(3)
hi , I came acroos two functions fdopen() and freopen().
what is the difference between these two functions and where can they be used. Is it that fdopen() is used to write freopen().
Advance Thanks for your co-operation.
:) (1 Reply)
Hi
I have a shared object which is called from a third party tool.
In my .so, I am using 'freopen(mylogfilename,"at",stderr)'. It is logging all my program output and it is also writing warning messages from the third party daemons also.
How can I avoid these unwanted messages... (1 Reply)
I always assumed the fopen/freopen is very costly, so when I needed to work with many files within on process I spent extra time to implement a list of FILE * pointers to avoid extra open/reopen but it did not produced any better results.
Here is a task at hand - there is a huge stream of data... (4 Replies)