maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
pwd.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* pwd.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: dmdemirk <dmdemirk@student.42london.c +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/06/17 11:10:33 by dmdemirk #+# #+# */
9/* Updated: 2024/09/06 12:01:53 by dmdemirk ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include "shell.h"
14#include <unistd.h>
15#include "libft.h"
16#include <stdio.h>
17#include "exit_status.h"
18
19/*
20Functionality:
21- Print the current working directory
22 */
23
25{
26 char cwd[4096];
27
28 (void)data;
29 if (getcwd(cwd, sizeof(cwd)) != NULL)
30 ft_putendl_fd(cwd, STDOUT_FILENO);
31 return (EXIT_SUCCESS);
32}
#define EXIT_SUCCESS
Definition exit_status.h:16
void ft_putendl_fd(char *s, int fd)
int builtin_pwd(t_ms_data *data)
Definition pwd.c:24