summaryrefslogtreecommitdiff
path: root/Source/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel')
-rw-r--r--Source/Kernel/VFS/DirectoryNode.class.cpp7
-rw-r--r--Source/Kernel/VFS/DirectoryNode.class.h1
-rw-r--r--Source/Kernel/VFS/FSNode.proto.h2
3 files changed, 8 insertions, 2 deletions
diff --git a/Source/Kernel/VFS/DirectoryNode.class.cpp b/Source/Kernel/VFS/DirectoryNode.class.cpp
index 55365f0..18bc41a 100644
--- a/Source/Kernel/VFS/DirectoryNode.class.cpp
+++ b/Source/Kernel/VFS/DirectoryNode.class.cpp
@@ -30,6 +30,11 @@ u32int DirectoryNode::getNameChildSC(u32int name) {
return (u32int) - 1;
}
+const String& DirectoryNode::getName() {
+ if (m_name == "/" && m_parent != NULL) return m_parent->getName();
+ return m_name;
+}
+
u64int DirectoryNode::getLength() {
if (m_mounts != 0) return m_mounts->getLength();
if (!m_contentLoaded)
@@ -39,7 +44,7 @@ u64int DirectoryNode::getLength() {
}
FSNode* DirectoryNode::getParent() {
- //if (m_name == "/" and m_parent != 0) return m_parent->getParent();
+ if (m_name == "/" and m_parent != 0) return m_parent->getParent();
return m_parent;
}
diff --git a/Source/Kernel/VFS/DirectoryNode.class.h b/Source/Kernel/VFS/DirectoryNode.class.h
index 1fc4c52..ded9af8 100644
--- a/Source/Kernel/VFS/DirectoryNode.class.h
+++ b/Source/Kernel/VFS/DirectoryNode.class.h
@@ -27,6 +27,7 @@ class DirectoryNode : public FSNode {
Vector<FSNode*> &getChildren() { return m_children; } //MUST BE USED ONLY BY FILESYSTEMS
u8int type() { return NT_DIRECTORY; }
+ const String& getName();
u64int getLength();
FSNode* getParent();
bool removable();
diff --git a/Source/Kernel/VFS/FSNode.proto.h b/Source/Kernel/VFS/FSNode.proto.h
index a46c79d..3e5c5a7 100644
--- a/Source/Kernel/VFS/FSNode.proto.h
+++ b/Source/Kernel/VFS/FSNode.proto.h
@@ -43,7 +43,7 @@ class FSNode : public Ressource {
virtual bool removable() = 0; //True for files, false for non-empty directories, true otherwise
virtual bool used() { return false; } //True if file is read/written from/to
- const String& getName() { return m_name; }
+ virtual const String& getName() { return m_name; }
virtual u64int getLength() { return m_length; }
u32int getPermissions() { return m_permissions; }
u32int getUid() { return m_uid; }