feat: update structure

This commit is contained in:
2024-01-22 14:27:40 +08:00
parent 7836c9185c
commit 3544a28a2e
559 changed files with 120846 additions and 4102 deletions

View File

@@ -0,0 +1,24 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <sys/wait.h>
int main() {
int fp_in = open("./file.txt", O_RDONLY);
int fp_out = open("./talk.out", O_CREAT | O_WRONLY);
if(fork() == 0) {
dup2(fp_in, STDIN_FILENO);
dup2(fp_out, STDOUT_FILENO);
execlp("./talk", "talk", (char *) 0);
close(fp_in);
close(fp_out);
}
else
wait(NULL);
}