explain_fopen_or_die(3) Library Functions Manual explain_fopen_or_die(3)NAME
explain_fopen_or_die - open file and report errors
SYNOPSIS
#include <libexplain/fopen.h>
FILE *explain_fopen_or_die(const char *pathname, const char *flags);
DESCRIPTION
The explain_fopen_or_die() function opens the file whose name is the string pointed to by pathname and associates a stream with it. See
fopen(3) for more information.
This is a quick and simple way for programs to constitently report file open errors in a consistent and detailed fahion.
RETURN VALUE
Upon successful completion explain_fopen_or_die returns a FILE pointer.
If an error occurs, explain_fopen will be called to explain the error, which will be printed onto stderr, and then the process will termi-
nate by calling exit(EXIT_FAILURE).
SEE ALSO fopen(3)
stream open functions
explain_fopen(3)
explain fopen(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
AUTHOR
Written by Peter Miller <pmiller@opensource.org.au>
explain_fopen_or_die(3)
Check Out this Related Man Page
explain_opendir_or_die(3) Library Functions Manual explain_opendir_or_die(3)NAME
explain_opendir_or_die - open a directory and report errors
SYNOPSIS
#include <libexplain/opendir.h>
DIR *explain_opendir_or_die(const char *pathname);
DESCRIPTION
The explain_opendir_or_die function is used to call the opendir(3) system call. On failure an explanation will be printed to stderr,
obtained from explain_opendir(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:
DIR *dir = explain_opendir_or_die(pathname);
pathname
The pathname, exactly as to be passed to the opendir(3) system call.
Returns:
On success, a pointer to the directory stream. On failure, prints an explanation and exits, does not return.
SEE ALSO opendir(3)
open a directory
explain_opendir(3)
explain opendir(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_opendir_or_die(3)
Hi
I was trying to open a file with french name on Mac OS-X with open() and fopen() but it didn't work.Do we have any POSIX unix func. which can be used to open any file with special name.
if anybody has an idea plz help.
Thanks
Mohit (1 Reply)
this is the mksys b script....
can anyone explain .. what # and 1 in if condition
this is the first line of the script... it is not from middle of the script....
if
then
echo "Not enough parameters, need a client name for mksysb"
Usage="Usage: $0 <client name>"
... (2 Replies)
what is the difference between
fopen and open
fread and read
fwrite and write
open and create
why this much of functions for the i/o when everything does the same...?
What is their major difference?
In which case, which is the best to use.
:confused:'ed Collins (2 Replies)
This code works fine when I use a command line argument for fopen()'s parameter, but when I change it to a filename, the program freezes upon compilation. input.txt is definitely there, so I can't figure it out. Thanks.
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
int... (3 Replies)
Dear friends,
We are learning UNIX system programming as part of our course. I came across this simple program, which the teacher didn't explain well enough. could you please explain this program fully
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
int main()
{
int pid;... (2 Replies)
Please explain why this works. Am unable to find another definition for the '%', which would explain this behaviour:
spaceLeft=`df -h /myPartition | tail -1`
# output looks like: /dev/sda5 10G 1.2G 12G 29% /
set -- $space
#this deletes the trailing '%' sign, which is... (6 Replies)
Hello,
I have a problem here, I want to write a function called"myfopen()" instead of "fopen()"
for writing this function I must not use the <stdio.h> library,
Can you help me?
thanks a lot (2 Replies)
Hi,
I'm new to this and very much interested to learn unix.
Can any one explain me the symbols y we use this is scripting(~ and $).
It would be great if some one explain with the eg.
Thanks
Naveen A (2 Replies)