diff options
Diffstat (limited to 'Source/Library')
-rw-r--r-- | Source/Library/Interface/FSNode.iface.h | 9 | ||||
-rw-r--r-- | Source/Library/Userland/Binding/FSNode.class.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Source/Library/Interface/FSNode.iface.h b/Source/Library/Interface/FSNode.iface.h index 3a5dfad..e6c45d3 100644 --- a/Source/Library/Interface/FSNode.iface.h +++ b/Source/Library/Interface/FSNode.iface.h @@ -1,6 +1,14 @@ #ifndef DEF_FSNODE_IFACE_H #define DEF_FSNODE_IFACE_H +/* + * The FSNode interface handles all this : + * - Navigating in the filesystem + * - Listing contents of directories + * - Creating/removing/truncating files and directories + * - Getting/Setting current working directory (CWD) + */ + enum { NT_FILE = 1, NT_DIRECTORY = 2, @@ -14,6 +22,7 @@ enum { #define FNIF_SGETRFN 0 #define FNIF_SGETCWD 1 //Get current working directory #define FNIF_SFIND 2 //Find a node following a path from a node +#define FNIF_SMKDIR 3 //Makes a directory #define FNIF_GETNAME 0x10 #define FNIF_TYPE 0x11 diff --git a/Source/Library/Userland/Binding/FSNode.class.h b/Source/Library/Userland/Binding/FSNode.class.h index 1fdc7ef..6a860ea 100644 --- a/Source/Library/Userland/Binding/FSNode.class.h +++ b/Source/Library/Userland/Binding/FSNode.class.h @@ -61,6 +61,11 @@ inline FSNode find(String name, FSNode cwd = FSNode(0)) { return FSNode(RessourceCaller::sCall(FNIF_OBJTYPE, FNIF_SFIND, (u32int)&name, cwd.resId())); } +inline FSNode mkdir(String name, FSNode cwd = FSNode(0)) { + if (!cwd.valid()) cwd = rootNode(); + return FSNode(RessourceCaller::sCall(FNIF_OBJTYPE, FNIF_SMKDIR, (u32int)&name, cwd.resId())); +} + } #endif |