[🗑️] clean: cleaned project.
This commit is contained in:
1 parent
75aad4842b
commit
9cb0e173c0
21 files changed
+32
-67
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.
Binary file not shown.
Binary file not shown.
@@ -6,7 +6,7 @@
|
||||
# By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# 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 #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
|
||||
@@ -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.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+3
-2
@@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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);
|
||||
dup2(fd[0], STDIN_FILENO);
|
||||
close(fd[0]);
|
||||
dup2(outfile, STDOUT_FILENO);
|
||||
close(outfile);
|
||||
close(fd[0]);
|
||||
close(fd[1]);
|
||||
close(pipex->infile);
|
||||
execve(pipex->cmd[1].cmd, pipex->cmd[1].option, pipex->env);
|
||||
}
|
||||
return (pid);
|
||||
|
||||
+26
-3
@@ -6,13 +6,35 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 "parsing.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)
|
||||
{
|
||||
@@ -71,9 +93,10 @@ int main(int ac, char **av, char **env)
|
||||
pipex->cmd = parse_cmd(ac - 3, av);
|
||||
pipex->env = env;
|
||||
getpath(pipex);
|
||||
if (pipex->path == NULL)
|
||||
ft_senderror(pipex, "Error : Can't find path");
|
||||
if (pipex->path)
|
||||
get_arrcmd_path(pipex);
|
||||
else
|
||||
check_cmd_validity(pipex);
|
||||
exec_pipe(pipex);
|
||||
ft_freearr(pipex->path);
|
||||
free_pcmd(pipex->cmd);
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* 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 */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
Reference in new issue
Block a user