|
myshell 2.0.0
|
Structure representing a single redirectee. More...
#include <msh_redirect.h>
Public Member Functions | |
| int | open_redirect (std::vector< int > *fd_to_close, int flags, int mode) const |
| Opens the redirection target. | |
Public Attributes | |
| int | fd = -1 |
| std::string | path |
Structure representing a single redirectee.
Holds either a file descriptor or a path to a file.
|
inline |
Opens the redirection target.
If the redirectee is a file descriptor, it is returned. If the redirectee is a path, it is opened and the file descriptor pointing to it is returned and added to fd_to_close.
| fd_to_close | A vector of file descriptors to close. |
| flags | Flags to pass to open(2). |
| mode | Mode to pass to open(2). |