How jiyan-0525/42core_pipex works
Pipex is a command-line program that reproduces a two-command shell pipeline: it takes an input file and two command strings, connects the commands through a Unix pipe, and directs the final output to a file. The main workflow validates arguments, launches two processes, configures their file descriptors, resolves and executes each command, and waits for completion. The repository also includes libft, a custom C utility library. The graph follows the sampled runtime sources and README; details beyond those excerpts are not inferred.
Main entry points: pipex.c Process orchestrator · pipex_util.c Command execution · pipex.h Pipex declarations · libft Utility functions
Components 15
Pipeline runtime
- Argument entry
src/pipex.c - Process orchestrator
src/pipex.c - First command process
src/pipex.c - Second command process
src/pipex.c - IPC pipe
src/pipex.c - Input file
- Output file
Command execution
- Command execution
src/pipex_util.c - PATH resolver
src/pipex_util.c
C utility library
- Utility functions
libft - Pipex declarations
include/pipex.h - Libft declarations
libft/libft.h
Other components
- CLI user
- Process environment
- Unix commands
Connections 17
- CLI user → Argument entry: supplies arguments
README.md - Argument entry → Process orchestrator: starts pipeline
src/pipex.c - Process orchestrator → First command process: forks child
src/pipex.c - Process orchestrator → Second command process: forks parent
src/pipex.c - Process orchestrator → IPC pipe: creates pipe
src/pipex.c - Process orchestrator → Process orchestrator: waits for processes
src/pipex.c - First command process → Input file: reads
src/pipex.c - First command process → IPC pipe: writes
src/pipex.c - Second command process → IPC pipe: reads
src/pipex.c - Second command process → Output file: writes
src/pipex.c - First command process → Command execution: executes command
src/pipex.c - Second command process → Command execution: executes command
src/pipex.c - Command execution → PATH resolver: resolves executable
src/pipex_util.c - PATH resolver → Process environment: searches PATH
src/pipex_util.c - Command execution → Unix commands: execve replaces process
src/pipex_util.c - Command execution → Utility functions: uses string helpers
src/pipex_util.c - Pipex declarations → Libft declarations: includes declarations
include/pipex.h