apps: add a little mkdir utility
This commit is contained in:
parent
c2a08060cf
commit
497a52dd82
@ -1,4 +1,4 @@
|
||||
APPS := init sh uname uptime hello ps ls args cat stat su session date
|
||||
APPS := init sh uname uptime hello ps ls args cat stat su session date mkdir
|
||||
|
||||
APPS_DIR := $(LUNA_ROOT)/apps
|
||||
APPS_SRC := $(APPS_DIR)/src
|
||||
|
17
apps/src/mkdir.c
Normal file
17
apps/src/mkdir.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc == 1)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [directory]", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (mkdir(argv[1], 0755) < 0)
|
||||
{
|
||||
perror("mkdir");
|
||||
return 1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user