AIX – Location of stdin, stdout, stderr File Descriptors

aixstderrstdinstdout

In my Linux environment, the file descriptors are located on /dev/fd.

Where is the location of stdin, stdout, stderr file descriptor in AIX(unix).

I couldn't find them.

Best Answer

The question is based on a misconception about the generality of proc filesystems. Systems which implement this (such as Solaris and Linux) have special devices which may be used for scripting, including /dev/fd followed by a file descriptor (number).

With Solaris, /dev/fd is a virtual folder under /dev, while Linux uses a symbolic link to /proc into a (virtual) folder matching your process id. There are no standards for proc filesystems, and details will differ.

Checking AIX 5.3 and 7.1 systems, they do implement a proc filesystem, but have no /dev/fd. However, they do have a virtual filesystem /proc, under which you can find your current process-id, and under that is an fd folder with file descriptors.

Conventionally, file descriptors are initialized 0, 1, 2 for stdin, stdout, stderr respectively.

Further reading:

Related Question