fs Add mkd subcommand for creating directories
This commit is contained in:
17
user/fs/mkd.c
Normal file
17
user/fs/mkd.c
Normal file
@ -0,0 +1,17 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <ulib.h>
|
||||
|
||||
void fs_mkd(void) {
|
||||
if (argslen() < 2) {
|
||||
uprintf("fs: Not enough arguments\n");
|
||||
return;
|
||||
}
|
||||
|
||||
char *path = *(args()+1);
|
||||
|
||||
int32_t r = ioctl(IOCTL_NOHANDLE, IOCTL_MKDIR, (uint64_t)path, 0, 0);
|
||||
if (r != E_OK) {
|
||||
uprintf("fs: could not create %s\n", path);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user