minishell
Minishell Project for École 42
Loading...
Searching...
No Matches
process_out_append.c File Reference

Subfunctions of process_out_append(), handles output redirections and appends. More...

#include "minishell.h"
Include dependency graph for process_out_append.c:

Functions

bool close_outputfile (int fd)
 Closes and file descriptor.
 
bool open_outputfile (t_executor *current, t_lexer_list *lexer)
 Handles opening an output file.
 

Detailed Description

Subfunctions of process_out_append(), handles output redirections and appends.

Function Documentation

◆ close_outputfile()

bool close_outputfile ( int  fd)

Closes and file descriptor.

Closes an output file descriptor, checking for errors.

Parameters
fdThe file descriptor to close.
Returns
True if closed successfully, false on error.

◆ open_outputfile()

bool open_outputfile ( t_executor current,
t_lexer_list lexer 
)

Handles opening an output file.

Handles opening an output file for the given t_executor node, based on the given lexer list token type. It supports truncating and appending to the file.

Parameters
currentA pointer to the current t_executor node.
lexerA pointer to the current t_lexer_list node.
Returns
True if the file is opened and closed successfully, false on error.