Sponsored Content
Full Discussion: fprintf
Top Forums Programming fprintf Post 302251991 by mirusnet on Tuesday 28th of October 2008 01:42:05 PM
Old 10-28-2008
fprintf

Could someone explain me the following fprintf format:

fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);

Why just not use:

fprintf(stderr, "ry `%s --help' for more information.\n", program_name)

I mean what is _() does?
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to write to file using fprintf in find command...

:D I once again am looking through the man pages and am still working on the find command to fully comprehend all its attributes.. i am a little stuck on a problem with how many options to -print there are and the only two I know how to use are printf and -print.. i can not make heads or tails of... (2 Replies)
Discussion started by: moxxx68
2 Replies

2. Shell Programming and Scripting

Detect sprintf and fprintf bad use

Hello again, I don't know about regexp so I throw this question here: How can I detect files where, for example: sprintf (var1, "hello %s %s", sub1); The problem here is that we have 2 %s and only a variable. Or... the inverse: sprintf (var1, "hello %s %s", sub1, sub2, sub3,...subn); ... (2 Replies)
Discussion started by: albertogarcia
2 Replies

3. Programming

fprintf() gives segmentation fault

Hi, I am using fprintf to write few strings toa file which has been opened in write mode. The syntax is as follows: printf("Testing 7A.\n"); fprintf(out_screen,"%s|%s|%s|%s|%s|\n",var1,var2,var3,var4,var5); printf("Testing 8.\n"); When I execute the code It prints "Testing 7A." then... (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

4. Shell Programming and Scripting

Fprintf issue

i had to send a mail an attachment which i got from find command. But i did not get mail but could see the following line in the logs "aliased to fprintf.c". Can someone help me to understand what does it mean?..As this issue is not occuring now, i could not replicate the problem now.Thanks. (1 Reply)
Discussion started by: jesu
1 Replies
explain_fprintf_or_die(3)				     Library Functions Manual					 explain_fprintf_or_die(3)

NAME
explain_fprintf_or_die - formatted output conversion and report errors SYNOPSIS
#include <libexplain/fprintf.h> int explain_fprintf_or_die(FILE *fp, const char *format, ...); int explain_fprintf_on_error(FILE *fp, const char *format, ...); DESCRIPTION
The explain_fprintf_or_die function is used to call the fprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fprintf(3) function, and then the process terminates by calling exit(EXIT_FAILURE). The explain_fprintf_on_error function is used to call the fprintf(3) system call. On failure an explanation will be printed to stderr, obtained from the explain_fprintf(3) function, but still returns to the caller. fp The fp, exactly as to be passed to the fprintf(3) system call. format The format, exactly as to be passed to the fprintf(3) system call. RETURN VALUE
The explain_fprintf_or_die function only returns on success, see fprintf(3) for more information. On failure, prints an explanation and exits, it does not return. The explain_fprintf_on_error function always returns the value return by the wrapped fprintf(3) system call. EXAMPLE
The explain_fprintf_or_die function is intended to be used in a fashion similar to the following example: int result = explain_fprintf_or_die(fp, format, ...); SEE ALSO
fprintf(3) formatted output conversion explain_fprintf(3) explain fprintf(3) errors exit(2) terminate the calling process COPYRIGHT
libexplain version 0.52 Copyright (C) 2010 Peter Miller explain_fprintf_or_die(3)
All times are GMT -4. The time now is 04:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy