Update MentOs code to the latest development version.

This commit is contained in:
Enrico Fraccaroli
2021-10-04 11:44:02 +02:00
parent 6fd063984a
commit b01eccca2e
484 changed files with 42358 additions and 20285 deletions
+30
View File
@@ -0,0 +1,30 @@
/// MentOS, The Mentoring Operating system project
/// @file mkdir.c
/// @brief
/// @copyright (c) 2014-2021 This file is distributed under the MIT License.
/// See LICENSE.md for details.
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <strerror.h>
int main(int argc, char *argv[])
{
// Check the number of arguments.
if (argc != 2) {
printf("%s: missing operand.\n", argv[0]);
printf("Try '%s --help' for more information.\n\n", argv[0]);
return 1;
}
if (strcmp(argv[1], "--help") == 0) {
printf("Creates a new directory.\n");
printf("Usage:\n");
printf(" %s <directory>\n", argv[0]);
return 0;
}
if (mkdir(argv[1], 0)) {
printf("%s: cannot create directory '%s': %s\n", argv[0], argv[1], strerror(errno));
}
return 0;
}