Bash – Do redirections operate on file descriptors or file handles

bashfile-descriptorsio-redirection

From https://www.gnu.org/s/bash/manual/html_node/Redirections.html

Before a command is executed, its input and output may be redirected using a special notation interpreted by the shell. Redirection allows commands’ file handles to be duplicated, opened, closed, made to refer to different files, and can change the files the command reads from and writes to. Redirection may also be used to modify file handles in the current shell execution environment.

Yet, the following text in the link shows that redirections operate on file descriptors (which are integers).

File handles and file descriptors are different. From https://en.wikipedia.org/wiki/File_descriptor#Overview, file handles are data structures of FILE in the C standard library. File descriptors are objects in Unix and Unix-like operating systems.

What does the bash manual mean by "file handles" in the quote?

Best Answer

The Bash documentation is using the term 'file handle' as a synonym for 'file descriptor'.

There's no requirement for programs to use the C Standard Library for I/O. Obviously, if they do, they can use fdopen() to obtain a (pointer to a) FILE structure from one of the file descriptors.

Related Question