From 3bd3984e92fdfb529c37b31c6f0570abab1ed54e Mon Sep 17 00:00:00 2001 From: WlodekM Date: Fri, 14 Feb 2025 19:12:47 +0200 Subject: initial commit; beginning work on smolsh --- progs/touch/touch.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 progs/touch/touch.c (limited to 'progs/touch/touch.c') diff --git a/progs/touch/touch.c b/progs/touch/touch.c new file mode 100644 index 0000000..815dae3 --- /dev/null +++ b/progs/touch/touch.c @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +int main(int argc, char *argv[]) { + if (!argv[1]) { + write(1, "you IDIOT, you forgot to include the file name, MORON\n", 55); + exit(1); + } + int fd2 = open(argv[1], O_RDWR | O_CREAT, S_IRUSR | S_IRGRP | S_IROTH); + exit(0); +} \ No newline at end of file -- cgit 1.4.1-2-gfad0