-
Notifications
You must be signed in to change notification settings - Fork 0
/
pwd.c
35 lines (31 loc) · 1.13 KB
/
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
27
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: apashkov <apashkov@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/18 13:24:16 by pgober #+# #+# */
/* Updated: 2024/04/03 15:53:29 by apashkov ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
int pwd(void)
{
char *cwd;
cwd = getcwd(NULL, 1024);
if (!cwd)
{
perror("pwd");
return (1);
}
ft_putendl_fd(cwd, 1);
free(cwd);
return (0);
}
/*int main()
{
if (pwd() == 0)
printf("DONE\n");
return (0);
}*/