aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/posix/posix-fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs/posix/posix-fs.cpp')
-rw-r--r--backends/fs/posix/posix-fs.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index ea874c9d0e..c0914bdb43 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -50,7 +50,7 @@ protected:
public:
POSIXFilesystemNode();
- POSIXFilesystemNode(const String &path, bool verify = false);
+ POSIXFilesystemNode(const String &path, bool verify);
virtual String displayName() const { return _displayName; }
virtual bool isValid() const { return _isValid; }
@@ -74,6 +74,12 @@ static const char *lastPathComponent(const Common::String &str) {
return cur + 1;
}
+AbstractFilesystemNode *AbstractFilesystemNode::getCurrentDirectory() {
+ char buf[MAXPATHLEN];
+ getcwd(buf, MAXPATHLEN);
+ return new POSIXFilesystemNode(buf, true);
+}
+
AbstractFilesystemNode *AbstractFilesystemNode::getRoot() {
return new POSIXFilesystemNode();
}
@@ -156,7 +162,7 @@ bool POSIXFilesystemNode::listDir(AbstractFSList &myList, ListMode mode) const {
newPath += '/';
newPath += dp->d_name;
- POSIXFilesystemNode entry(newPath);
+ POSIXFilesystemNode entry(newPath, false);
#ifdef __DC__
entry._isDirectory = dp->d_size < 0;
@@ -212,7 +218,7 @@ AbstractFilesystemNode *POSIXFilesystemNode::parent() const {
const char *start = _path.c_str();
const char *end = lastPathComponent(_path);
- POSIXFilesystemNode *p = new POSIXFilesystemNode(String(start, end - start));
+ POSIXFilesystemNode *p = new POSIXFilesystemNode(String(start, end - start), false);
return p;
}