19# define TMP_PATH "/tmp/"
struct s_data t_data
Definition data_structure.h:38
struct s_command t_command
Definition data_structure.h:35
struct s_garbage t_garbage
Definition data_structure.h:26
struct s_tmp t_tmp
Definition data_structure.h:21
struct s_file t_file
Definition data_structure.h:22
struct s_token t_token
Definition data_structure.h:37
t_tmp create_tmp(t_garbage *garbage, char *path, int nbr_try)
Create a tmp file, verify if it already exist, tries to open it to verify permissions,...
Definition tmp_generator.c:33
t_file * search_last_file(t_file *file, t_file *already_searched)
Return the last file that is not already_searched.
Definition file_verify_access.c:33
t_command * remove_used_file_tokens(t_data *data)
Removes all the tokens of file redirections allready used.
Definition ft_file_tokens.c:27
char * ft_trim_word(char *str)
void * add_file(t_garbage *garbage, t_command *command, t_token *token, t_file **command_file)
Add a file to the stack given in param, each file added is at the beginning of the stack (reverse ord...
Definition file.c:94
int build_files_redirection(t_data *data)
Adds files to the file redirection structure.
Definition file_build.c:26
int fill_heredocs(t_garbage *garbage, t_command *command)
Fill all the heredocs in the correct order.
Definition heredoc.c:108
void fd_default(t_command *command)
Put the fds in command to there default values.
Definition file-general.c:120
int files_management(t_data *data)
Executes all the files redirection tests.
Definition file-general.c:28
char * read_heredoc(t_tmp *tmp, char *delimiteur)
Read from stdin and outputs to a file, stops reading when Ctrl+D or when a delimitor is found.
Definition heredoc.c:34
int build_files_data(t_command *command)
Build the data around the files in all commands.
Definition file_build.c:61
int build_file_access(t_file *file)
Build the file using access and check permissions.
Definition file.c:25
t_file * file_parser(t_file *file)
Parse the file structure.
Definition file.c:52
void read_write_to(t_garbage *garbage, t_command *command, t_bool in_out)
Opens the files to read and writes.
Definition file-general.c:92
int verify_access(t_garbage *garbage, t_command *command)
Verify that all files are valid if at least one file is invalid, modifies the boolean in command but ...
Definition file_verify_access.c:159
int open_file_with_rights(t_garbage *garbage, t_file *file, t_bool in_out)
Open a file with it's rights (permissions)
Definition file-general.c:61
Structure to handle all the data of a file.
Definition file.h:39
t_bool is_heredoc
Definition file.h:47
char * name
Definition file.h:41
t_file * next
Definition file.h:40
t_bool perm_read
Definition file.h:45
t_bool exist
Definition file.h:44
t_bool parsed
Definition file.h:43
t_bool is_append
Definition file.h:48
t_tmp * tmp
Definition file.h:42
t_bool perm_write
Definition file.h:46
Basic structure to help manipulating heredocs (tmp file)
Definition file.h:29
char * name
Definition file.h:30
int fd
Definition file.h:31