MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / ensurePathIsLocal

Method ensurePathIsLocal

source/io/fsfilenode.cpp:182–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void 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
203FsOpenNode* FsFileNode::open(U32 flags) {
204 U32 openFlags = O_BINARY;

Callers 2

renameMethod · 0.95
setTimesMethod · 0.95

Calls 4

isDirectoryMethod · 0.80
moveToFileSystemMethod · 0.80
lockMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected