Gast
#1500158
Hallo, wie kann ein Prozess feststellen, ob die Ausgaben die es in stdout schreibt, auf Bildschirm kommen oder in eine Datei umgeleitet werden? Grüsse, Daniel
|
Anzeige
|
Linux: Feststellen ob stdout umgeleitet wird oder nicht?
Gast
#1500158
Hallo, wie kann ein Prozess feststellen, ob die Ausgaben die es in stdout schreibt, auf Bildschirm kommen oder in eine Datei umgeleitet werden? Grüsse, Daniel "isatty() is a function that returns TRUE if the handle is associated with a TTY (e.g. keyboard, screen, printer, serial port), and FALSE in the other circumstances (e.g. the handle is associated with a regular file, or is a part of a pipeline). For example, if the standard output is redirected to a file, or piped to another program, then isatty(STDOUT) returns FALSE." http://www.cs.toronto.edu/~ramona/cosmin//TA/prog/sysconf/ http://linux.die.net/man/3/isatty
Gast
#1500320
Danke. Falls jemand nachvollziehen möchte.
Antwort schreibenBitte melde dich an, um einen Beitrag zu schreiben. |
Anzeige
|