FileNodeRef FileSystemRedirect::create(const Path& path,FileNode::Mode mode) { Path p = _merge(path); FileSystemRef fs = mMFS->getFileSystem(p); if (fs != NULL) return fs->create(p,mode); return NULL; }
FileRef MountSystem::createFile(const Path& path) { Path np = _normalize(path); FileSystemRef fs = _getFileSystemFromList(np); if (fs && fs->isReadOnly()) { _log(String::ToString("Cannot create file %s, filesystem is read-only", path.getFullPath().c_str())); return NULL; } if (fs != NULL) return static_cast<File*>(fs->create(np,FileNode::File).getPointer()); return NULL; }
DirectoryRef MountSystem::createDirectory(const Path& path, FileSystemRef fs) { Path np = _normalize(path); if (fs.isNull()) fs = _getFileSystemFromList(np); if (fs && fs->isReadOnly()) { _log(String::ToString("Cannot create directory %s, filesystem is read-only", path.getFullPath().c_str())); return NULL; } if (fs != NULL) return static_cast<Directory*>(fs->create(np,FileNode::Directory).getPointer()); return NULL; }