| 180 | } |
| 181 | |
| 182 | void FsFileNode::ensurePathIsLocal(bool prepareForWrite) { |
| 183 | #ifdef BOXEDWINE_ZLIB |
| 184 | BOXEDWINE_CRITICAL_SECTION; |
| 185 | if (this->zipNode && !Fs::doesNativePathExist(this->nativePath)) { |
| 186 | if (this->isDirectory()) { |
| 187 | Fs::makeLocalDirs(this->path); |
| 188 | } else { |
| 189 | BString parentPath = Fs::getParentPath(this->path); |
| 190 | Fs::makeLocalDirs(parentPath); |
| 191 | this->zipNode->moveToFileSystem(shared_from_this()); |
| 192 | } |
| 193 | } else if (prepareForWrite) { |
| 194 | std::shared_ptr<FsNode> parent = this->getParent().lock(); |
| 195 | if (parent && parent->type == Type::File) { |
| 196 | BString parentPath = Fs::getParentPath(this->path); |
| 197 | Fs::makeLocalDirs(parentPath); |
| 198 | } |
| 199 | } |
| 200 | #endif |
| 201 | } |
| 202 | |
| 203 | FsOpenNode* FsFileNode::open(U32 flags) { |
| 204 | U32 openFlags = O_BINARY; |
no test coverage detected