mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
de4604ac95
Added a /bin/mkdir that makes directories. How very neat :^) There are various limitations because of missing functionality.
21 lines
379 B
C++
21 lines
379 B
C++
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <errno.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
#include <sys/stat.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 2) {
|
|
printf("usage: mkdir <path>\n");
|
|
return 1;
|
|
}
|
|
int rc = mkdir(argv[1], 0755);
|
|
if (rc < 0) {
|
|
perror("mkdir");
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|