bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

translator stderr (was: hurd/trans/hello.c changes)


From: olafBuddenhagen
Subject: translator stderr (was: hurd/trans/hello.c changes)
Date: Sun, 27 Dec 2009 23:47:40 +0100
User-agent: Mutt/1.5.19 (2009-01-05)

Hi,

On Thu, Dec 24, 2009 at 12:32:53PM +0530, Shakthi Kannan wrote:

> | Printing to a file is nothing fancy: the fprintf functions should |
> suffice.
> 
> I would appreciate if I could see a working example. When I use
> fprintf(stdout, "message"); or fprintf(stderr, "error"); in a
> translator, and use it with:
> 
>   settrans -fgap /tmp/hello hello 1>out 2>err
> 
> neither of them are going into out or err, or the console.

First of all, fprintf(stdout, ...) is the same as printf(...), so it
won't help at all.

fprintf(stderr, ...) should work though.

Note though that it only works with active translators -- passive ones
never print anything to the terminal.

Also, you obviously do not see anything on the console, when redirecting
stdout/stderr to files...

> | Also, some translators use the error () function for
> 
> This dumps the message to err, and works fine. I would like to see a
> working fprintf example in a translator.

If error() works, fprintf(stderr, ...) should do just as well.

-antrik-




reply via email to

[Prev in Thread] Current Thread [Next in Thread]