Initial commit

This commit is contained in:
2021-10-01 20:24:05 +02:00
commit 860c025165
194 changed files with 4846 additions and 0 deletions

22
kapitel13/mytouch.c Normal file
View File

@@ -0,0 +1,22 @@
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
int main(int argc, char *argv[])
{
if (argc != 2)
{
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
return 1;
}
/* Rättigheterna nedan blir 644, Read/Write user,
Read group, Read others */
creat(argv[1], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (errno != 0)
{
perror("creat");
return 1;
}
return 0;
}