FD(4) BSD Kernel Interfaces Manual FD(4)NAME
fd, stdin, stdout, stderr -- file descriptor files
DESCRIPTION
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is
open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call:
fd = open("/dev/fd/0", mode);
and the call:
fd = fcntl(0, F_DUPFD, 0);
are equivalent.
Opening the files /dev/stdin, /dev/stdout and /dev/stderr is equivalent to the following calls:
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored.
IMPLEMENTATION NOTES
By default, /dev/fd is provided by devfs(5), which provides nodes for the first three file descriptors. Some sites may require nodes for
additional file descriptors; these can be made available by mounting fdescfs(5) on /dev/fd.
FILES
/dev/fd/#
/dev/stdin
/dev/stdout
/dev/stderr
SEE ALSO tty(4), devfs(5), fdescfs(5)BSD June 9, 1993 BSD
Check Out this Related Man Page
FD(4) BSD Kernel Interfaces Manual FD(4)NAME
fd, stdin, stdout, stderr -- file descriptor files
DESCRIPTION
The files /dev/fd/0 through /dev/fd/# refer to file descriptors which can be accessed through the file system. If the file descriptor is
open and the mode the file is being opened with is a subset of the mode of the existing descriptor, the call:
fd = open("/dev/fd/0", mode);
and the call:
fd = fcntl(0, F_DUPFD, 0);
are equivalent.
Opening the files /dev/stdin, /dev/stdout and /dev/stderr is equivalent to the following calls:
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
fd = fcntl(STDOUT_FILENO, F_DUPFD, 0);
fd = fcntl(STDERR_FILENO, F_DUPFD, 0);
Flags to the open(2) call other than O_RDONLY, O_WRONLY and O_RDWR are ignored.
IMPLEMENTATION NOTES
By default, /dev/fd is provided by devfs(5), which provides nodes for the first three file descriptors. Some sites may require nodes for
additional file descriptors; these can be made available by mounting fdescfs(5) on /dev/fd.
FILES
/dev/fd/#
/dev/stdin
/dev/stdout
/dev/stderr
SEE ALSO tty(4), devfs(5), fdescfs(5)BSD June 9, 1993 BSD
first off, i am new to unix so please bear with me. i was reading somewhere that if your i-nodes get critical that it can slow your network down. what are i-nodes and when do they become a critical number? this is what mine states:
/ (/dev/root ): 777058 blocks 569290 i-nodes... (4 Replies)
Hi,
When it proccesing the backup with cpio report this message: Cannot open "/dev/tty" and cancel de backup.
Cuando se procesa la tarea del backup reporta el error: Cannot open "/dev/tty" y cancela el backup y no termina correctamente, a que se devera esta advertencia.
Gracias.
Thacks.... (3 Replies)
Hi everyone!
Well, this is the thing.. I sent a process's stdout to /dev/null. This process
is very time consuming and after a week it keeps running, what I need is
to switch the stdout back to screen to see what's going on.
Anyone know if it's possible and how to do it?
Thanks and... (3 Replies)
Hi,
Is it possible to check the Existence/read/write of stdin,stdout,stderr using access() call like for the files we do.
Ex: fd=access("./hi.txt",F_OK)
Similarly I wanna check stdin/tdout/stderr using access() call
I tried using fd=access(stdout,F_OK);
But the result is -1.
I... (3 Replies)
Hi,
Program A: uses pipe()
I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using:
* child
-> dup2(fd, STDOUT_FILENO);
-> execl("/path/PROGRAM B", "PROGRAM B", NULL);
* parent
-> char line;
-> read(fd, line, 100);
Question:
---------... (3 Replies)
Hi friends
I am facing one problem while redirecting the out of the stderr and stdout to a file
let example my problem with a simple example
I have a file (say test.sh)in which i run 2 command in the background
ps -ef &
ls &
and now i am run this file and redirect the output to a file... (8 Replies)
Hi all,
I've been looking for the way to send stdout and stderr to different files. Well, actually I really knew how to make it, but I wanted to be sure.
I've found an instruction very interesting which I'm not able to understand:
taken from this site. It says it sends stdout to output.log,... (4 Replies)
Hi all,
I want to know the device filename of STDIN in AIX.
On other platforms(Linux and solaris), the device file for stdin is available at /dev/ directory as "/dev/stdin".
But i didn't find any filename for STDIN at /dev/ directory in AIX.
Please let me know the name and location of device... (3 Replies)
Hi all,
I've been looking around for this for a while and can't seem to find a satifactory way to do what I want:
I would like to assign the output of stdout to a variable and that of stderr to another one, and this without using temporary files/named pipes. In other words be able to assign... (4 Replies)
I have a function called sysLogger in a bash script that I am using to redirect stdout and stderr to syslog.
Part of the script contains an option to turn on debugging otherwise I want debugging output to go to /dev/null.
I am struggling to understand how to make this work using the function... (10 Replies)
Hi all,
can someone help me with the next redirection?
i want to redirect the stdout+stderr of a command to the same file (this i can do by prog &> file)
but in addition i want to redirect only the stderr to a different file.
how can i do this please? (in BASH)
thanks. (4 Replies)
I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is... (3 Replies)
Hi folks
I need/want to redirect output (stdout, stderr) from an exec call to separate files. One for stderr only and two(!) different (!) ones for the combined output of stderr and stdout.
After some research and testing i got this so far :
(( exec ${command} ${command_parameters} 3>&1... (6 Replies)