myshell 2.0.0
Loading...
Searching...
No Matches
redirect Struct Reference

Structure representing a single redirection. More...

#include <msh_redirect.h>

Public Types

enum  { NONE , OUT , OUT_APPEND , IN }
 

Public Member Functions

 redirect (const Token &redirect_token)
 
int do_redirect (std::vector< int > *fd_to_close) const
 Opens the redirectees with respect to the redirection type and duplicates the appropriate file descriptors.
 

Public Attributes

struct redirectee in
 
struct redirectee out
 
bool both_err_out = false
 
enum redirect:: { ... }  type = NONE
 

Detailed Description

Structure representing a single redirection.

Holds two redirectees and the type of the redirection.

See also
redirects_t

Member Function Documentation

◆ do_redirect()

int redirect::do_redirect ( std::vector< int > * fd_to_close) const
inline

Opens the redirectees with respect to the redirection type and duplicates the appropriate file descriptors.

The fd_to_close vector is populated with any file descriptors that were opened during the redirection process.

Parameters
fd_to_closeA vector of file descriptors to close.
Returns
0 on success, 1 on error.

The documentation for this struct was generated from the following file: