Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

explain_fopen_or_die(3) [debian man page]

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)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

Mac OS X - open() and fopen() with French filename

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)
Discussion started by: mohit grover
1 Replies

2. UNIX for Dummies Questions & Answers

Please explain this command line ?

Please explain this command line ? wc<infile<newfile Thanx, Saneesh Joseph. (2 Replies)
Discussion started by: saneeshjose
2 Replies

3. UNIX for Dummies Questions & Answers

What does ls * do

Hi Can anyone please explain what this commands does? Thanks. (2 Replies)
Discussion started by: trivektor
2 Replies

4. Shell Programming and Scripting

Please can any one explain this ${0##/}

I did not understand what is ${0##/} PGM=${0##/} TMP=/tmp/${PGM}.$$ Please explain me. (2 Replies)
Discussion started by: gadege
2 Replies

5. AIX

can anyone explain this?

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)
Discussion started by: honeym210
2 Replies

6. UNIX for Dummies Questions & Answers

$? means?

Hi All, Can you please explain wats the meaning of this $? in unix Thanks (2 Replies)
Discussion started by: mathur
2 Replies

7. Programming

fopen and open

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)
Discussion started by: collins
2 Replies

8. Programming

fopen() - don't know what I'm doing wrong

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)
Discussion started by: lazypeterson
3 Replies

9. UNIX for Dummies Questions & Answers

when to use -ne and when to use !=

Hi guys, Its a simple question in if loop when shouid i use -ne and when should i use != please explain. thanks, ram. (2 Replies)
Discussion started by: ramky79
2 Replies

10. Shell Programming and Scripting

Can someone please explain what tr#A-Za-z0-9+/# -_#; means in perl?

Can someone please explain what tr#A-Za-z0-9+/# -_#; means in perl? (4 Replies)
Discussion started by: 3junior
4 Replies

11. Programming

fork(), could you explain!!

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)
Discussion started by: gabam
2 Replies

12. Shell Programming and Scripting

please explain why this ksh echo deletes character

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)
Discussion started by: frododot
6 Replies

13. UNIX for Advanced & Expert Users

Alternative open source to syncsort

Hi, I am looking for an opensource alternate to replace syncsort. Can you please suggest ? (8 Replies)
Discussion started by: AmbikaValagonda
8 Replies

14. Programming

help plz - fopen()

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)
Discussion started by: hamed.samie
2 Replies

15. Shell Programming and Scripting

Basic doubt in UNIX

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)
Discussion started by: Pranaveen
2 Replies