-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbi_pwd.c
26 lines (23 loc) · 1.06 KB
/
bi_pwd.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* bi_pwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wlalaoui <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/11 14:52:00 by wlalaoui #+# #+# */
/* Updated: 2024/01/19 10:02:56 by aoizel ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int bi_pwd(int fd_out)
{
char *cwd;
cwd = getcwd(NULL, 0);
if (!cwd)
return (1);
ft_putstr_fd(cwd, fd_out);
ft_putstr_fd("\n", fd_out);
free(cwd);
return (0);
}