explain_fgets_or_die(3) Library Functions Manual explain_fgets_or_die(3)NAME
explain_fgets_or_die - input of strings and report errors
SYNOPSIS
#include <libexplain/fgets.h>
char *explain_fgets_or_die(char *data, int data_size, FILE *fp);
DESCRIPTION
The explain_fgets_or_die function is used to call the fgets(3) system call. On failure an explanation will be printed to stderr, obtained
from explain_fgets(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_fgets_or_die(data, data_size, fp);
data The data, exactly as to be passed to the fgets(3) system call.
data_size
The data_size, exactly as to be passed to the fgets(3) system call.
fp The fp, exactly as to be passed to the fgets(3) system call.
Returns:
This function only returns on success; data when a line is read, or NULL on end-of-file. On failure, prints an explanation and
exits.
SEE ALSO fgets(3)
input of strings
explain_fgets(3)
explain fgets(3) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2008 Peter Miller
explain_fgets_or_die(3)
Check Out this Related Man Page
explain_gethostname_or_die(3) Library Functions Manual explain_gethostname_or_die(3)NAME
explain_gethostname_or_die - get/set hostname and report errors
SYNOPSIS
#include <libexplain/gethostname.h>
void explain_gethostname_or_die(char *data, size_t data_size);
intexplain_gethostname_on_error(char *data, size_t data_size);
DESCRIPTION
The explain_gethostname_or_die function is used to call the gethostname(2) system call. On failure an explanation will be printed to
stderr, obtained from the explain_gethostname(3) function, and then the process terminates by calling exit(EXIT_FAILURE).
The explain_gethostname_on_error function is used to call the gethostname(2) system call. On failure an explanation will be printed to
stderr, obtained from the explain_gethostname(3) function, but still returns to the caller.
data The data, exactly as to be passed to the gethostname(2) system call.
data_size
The data_size, exactly as to be passed to the gethostname(2) system call.
RETURN VALUE
The explain_gethostname_or_die function only returns on success, see gethostname(2) for more information. On failure, prints an explanation
and exits, it does not return.
The explain_gethostname_on_error function always returns the value return by the wrapped gethostname(2) system call.
EXAMPLE
The explain_gethostname_or_die function is intended to be used in a fashion similar to the following example:
explain_gethostname_or_die(data, data_size);
SEE ALSO gethostname(2)
get/set hostname
explain_gethostname(3)
explain gethostname(2) errors
exit(2) terminate the calling process
COPYRIGHT
libexplain version 0.52
Copyright (C) 2009 Peter Miller
explain_gethostname_or_die(3)
Hi Gurus,
sqlplus system @$1 0</opt/oracle/pwdfile
What would be the output of the above life....the password for the user "system" the user is stored in /opt/oracle/pwdfile
When i try to run the script it says password not found?
$1 0<
What is the meaning of the $1 and 0?
... (1 Reply)
Hi All,
can you please explain me the meaning of this line--
BackupLocation="/inpass/abc"
Parent=$(expr $BackupLocation : '\(.*\)/.*' \| $BackupLocation)
when i ran this as a command also it did not show me anything so could not get the purpose of this line.
Explain it please. (3 Replies)
Hello Friends,
I got stuck with fgets () & rewind() function .. Please need help..
Actually I am doing a like,
The function should read lines from a txt file until the function is called..
If the data from the txt file ends then it goes to the top and then again when the function is called... (1 Reply)
Hi all,
I have this method to read a string from a STDIN:
void readLine(char* inputBuffer){
fgets (inputBuffer, MAX_LINE, stdin);
fflush(stdin);
/* remove '\n' char from string */
if(strlen(inputBuffer) != 0)
inputBuffer = '\0';
}
All work fine but if i... (1 Reply)
I've been having trouble with reading past the end-of-file in C. Can anyone find my stupid mistake?
This is the minimal code needed to cause the error for me:
FILE *f = fopen(name, "r");
if (!f)
return;
pari_sp ltop = avma;
char line;
while(fgets(line, 1100, f) != NULL)
printf(".");... (23 Replies)
Hi,
I'm trying to populate bash script variable, data_size with the
size of the largest file in my current directory
data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }'
I've tried adding an echo before the call to awk
data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
i am reading and writing to a a file in C language. the input file is described as follows
111 aaa descr1
222 bbb descr2
333 ccc <SPACE> {6 spaces are left after ccc i.e in 3rd column}
444 ddd descr4
when i read and write to a file, the space is not coming in the output file.... (8 Replies)
I was wondering what is the correct way to read in data "one-part-per-line" as compared with "one-record-per-line" formats into the same structure in C?
format1.dat:
Zacker 244.00 244.00 542.00
Lee 265.00 265.00 456.00
Walter 235.00 235.00 212.00
Zena 323.00 215.45 ... (12 Replies)
I am building a wrapper around fgets, and fighting crashes for no reason I can explain.
I have stripped it down as far as I can and it still crashes.
#include <stdio.h>
#include <stdlib.h>
typedef struct {
char buf;
FILE *fp;
int type;
} wrap;
wrap... (12 Replies)