-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpwd.c
30 lines (27 loc) · 1.14 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wonyang <wonyang@student.42seoul.kr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/06 21:24:18 by wonyang #+# #+# */
/* Updated: 2023/01/13 21:50:37 by wonyang ### ########seoul.kr */
/* */
/* ************************************************************************** */
#include <unistd.h>
#include <stdlib.h>
#include "return.h"
#include "libft.h"
int ft_pwd(char **argv)
{
char *path;
argv = (char **)argv;
path = getcwd(NULL, 0);
if (!path)
return (1);
ft_putendl_fd(path, STDOUT_FILENO);
free(path);
path = NULL;
return (0);
}