[🗑️] clean: cleaned project.

This commit is contained in:
KeyZox committed 2024-04-08 15:36:35 +02:00
1 parent 75aad4842b
commit 9cb0e173c0
21 files changed
+33 -68

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -6,7 +6,7 @@
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ # # By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/11/01 11:03:22 by adjoly #+# #+# # # Created: 2023/11/01 11:03:22 by adjoly #+# #+# #
# Updated: 2024/03/28 21:59:20 by adjoly ### ########.fr # # Updated: 2024/04/08 15:21:46 by adjoly ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
-59
View File
@@ -1,59 +0,0 @@
[
{
"directory": "/nfs/homes/adjoly/Documents/pipex",
"arguments": [
"cc",
"-I",
"include/",
"-I",
"libft/",
"-Werror",
"-Wall",
"-Wextra",
"-g",
"src/main.c",
"-c",
"-o",
"obj/src/main.o"
],
"file": "src/main.c"
},
{
"directory": "/nfs/homes/adjoly/Documents/pipex",
"arguments": [
"cc",
"-I",
"include/",
"-I",
"libft/",
"-Werror",
"-Wall",
"-Wextra",
"-g",
"src/parsing/parsing.c",
"-c",
"-o",
"obj/src/parsing/parsing.o"
],
"file": "src/parsing/parsing.c"
},
{
"directory": "/nfs/homes/adjoly/Documents/pipex",
"arguments": [
"cc",
"-I",
"include/",
"-I",
"libft/",
"-Werror",
"-Wall",
"-Wextra",
"-g",
"src/utils/ft_freetab.c",
"-c",
"-o",
"obj/src/utils/ft_freetab.o"
],
"file": "src/utils/ft_freetab.c"
}
]
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
View File
Binary file not shown.
+3 -2
View File
@@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/06 14:07:27 by adjoly #+# #+# */ /* Created: 2024/04/06 14:07:27 by adjoly #+# #+# */
/* Updated: 2024/04/07 11:01:39 by adjoly ### ########.fr */ /* Updated: 2024/04/08 14:09:14 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -63,10 +63,11 @@ pid_t ft_exec_scnd_pipe(t_pipex *pipex, int fd[2])
{ {
outfile = open(pipex->outfile, O_CREAT | O_WRONLY | O_TRUNC, 0644); outfile = open(pipex->outfile, O_CREAT | O_WRONLY | O_TRUNC, 0644);
dup2(fd[0], STDIN_FILENO); dup2(fd[0], STDIN_FILENO);
close(fd[0]);
dup2(outfile, STDOUT_FILENO); dup2(outfile, STDOUT_FILENO);
close(outfile); close(outfile);
close(fd[0]);
close(fd[1]); close(fd[1]);
close(pipex->infile);
execve(pipex->cmd[1].cmd, pipex->cmd[1].option, pipex->env); execve(pipex->cmd[1].cmd, pipex->cmd[1].option, pipex->env);
} }
return (pid); return (pid);
+27 -4
View File
@@ -6,13 +6,35 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/21 10:03:04 by adjoly #+# #+# */ /* Created: 2024/03/21 10:03:04 by adjoly #+# #+# */
/* Updated: 2024/04/08 12:49:21 by adjoly ### ########.fr */ /* Updated: 2024/04/08 15:26:06 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "libft.h" #include "libft.h"
#include "parsing.h" #include "parsing.h"
#include "pipex.h" #include "pipex.h"
#include <unistd.h>
void check_cmd_validity(t_pipex *pipex)
{
t_pcmd *cmd;
cmd = pipex->cmd;
while (cmd)
{
if (access(cmd->cmd, X_OK) != 0)
{
// ft_freearr((*cmd).option);
// if (pipex->cmd[1].cmd)
// {
// ft_freearr(pipex->cmd[1].option);
// free(pipex->cmd[1].cmd);
// }
ft_senderror(pipex, "Error: Command not found");
}
cmd++;
}
}
void check_empty_args(char **av, t_pipex *pipex) void check_empty_args(char **av, t_pipex *pipex)
{ {
@@ -71,9 +93,10 @@ int main(int ac, char **av, char **env)
pipex->cmd = parse_cmd(ac - 3, av); pipex->cmd = parse_cmd(ac - 3, av);
pipex->env = env; pipex->env = env;
getpath(pipex); getpath(pipex);
if (pipex->path == NULL) if (pipex->path)
ft_senderror(pipex, "Error : Can't find path"); get_arrcmd_path(pipex);
get_arrcmd_path(pipex); else
check_cmd_validity(pipex);
exec_pipe(pipex); exec_pipe(pipex);
ft_freearr(pipex->path); ft_freearr(pipex->path);
free_pcmd(pipex->cmd); free_pcmd(pipex->cmd);
+1 -1
View File
@@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/04 15:32:56 by adjoly #+# #+# */ /* Created: 2024/04/04 15:32:56 by adjoly #+# #+# */
/* Updated: 2024/04/07 16:20:05 by adjoly ### ########.fr */ /* Updated: 2024/04/08 14:18:42 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
+1 -1
View File
@@ -6,7 +6,7 @@
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */ /* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/06 13:31:15 by adjoly #+# #+# */ /* Created: 2024/04/06 13:31:15 by adjoly #+# #+# */
/* Updated: 2024/04/08 12:54:26 by adjoly ### ########.fr */ /* Updated: 2024/04/08 14:39:01 by adjoly ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */