-
Notifications
You must be signed in to change notification settings - Fork 0
/
append.c
29 lines (24 loc) · 1.11 KB
/
append.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* append.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fvieira <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/02 20:35:05 by fvieira #+# #+# */
/* Updated: 2023/02/03 19:36:58 by fvieira ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int append(char *prompt)
{
int fd;
fd = open(prompt, O_CREAT | O_RDWR | O_APPEND, 0666);
return (fd);
}
int redirectout(char *prompt)
{
int fd;
fd = open(prompt, O_WRONLY | O_CREAT | O_TRUNC, 0666);
return (fd);
}