Renaming all folders

This commit is contained in:
Fabio Scotto di Santolo
2025-08-22 16:21:42 +02:00
parent 331308b2d8
commit 538cb4559e
45 changed files with 9 additions and 9 deletions

36
02_FileIO/fopenflags.c Normal file
View File

@@ -0,0 +1,36 @@
/*
* SPDX-License-Identifier: MIT
* Copyright (c) 2025 Fabio Scotto di Santolo
*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
int main(void)
{
int fd;
fd = open("test.txt", O_CREAT | O_EXCL);
if (fd == -1)
perror("First open");
close(fd);
fd = open("test.txt", O_CREAT | O_EXCL);
if (fd == -1)
perror("Second open");
close(fd);
fd = open("test.txt", O_CREAT | O_EXCL);
if (fd == -1)
perror("Third open");
close(fd);
fd = open("test.txt", O_CREAT);
if (fd == -1)
perror("Fourth open");
close(fd);
return 0;
}