summaryrefslogtreecommitdiff
path: root/Source/Kernel/VFS/VFS.ns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/VFS/VFS.ns.cpp')
-rw-r--r--Source/Kernel/VFS/VFS.ns.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Kernel/VFS/VFS.ns.cpp b/Source/Kernel/VFS/VFS.ns.cpp
index 6db791a..30ad2d7 100644
--- a/Source/Kernel/VFS/VFS.ns.cpp
+++ b/Source/Kernel/VFS/VFS.ns.cpp
@@ -40,6 +40,7 @@ FSNode* find(const String& path, FSNode* start) {
}
FSNode* createFile(const String& path, FSNode* start) {
+ if (find(path, start) != NULL) return NULL; //Something already has that name.
if (start == 0) start = rootNode;
Vector<String> p = path.split("/");
@@ -71,6 +72,7 @@ FSNode* createFile(const String& path, FSNode* start) {
}
FSNode* createDirectory(const String& path, FSNode* start) {
+ if (find(path, start) != NULL) return NULL; //Something already has that name.
if (start == 0) start = rootNode;
Vector<String> p = path.split("/");
@@ -102,7 +104,7 @@ FSNode* createDirectory(const String& path, FSNode* start) {
}
bool remove(const String& path, FSNode* start) {
- FSNode* node =find(path, start);
+ FSNode* node = find(path, start);
if (node == NULL) return false;
FSNode* parent = node->getParent();
if (parent == NULL) return false;