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

Method open

source/io/fsvirtualnode.cpp:40–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40FsOpenNode* FsVirtualNode::open(U32 flags) {
41 if ((flags & K_O_ACCMODE)==K_O_RDONLY) {
42 if (!this->canRead())
43 return nullptr;
44 } else if ((flags & K_O_ACCMODE)==K_O_WRONLY) {
45 if (!this->canWrite())
46 return nullptr;
47 } else {
48 if (!this->canWrite())
49 return nullptr;
50 if (!this->canRead())
51 return nullptr;
52 }
53 if (flags & K_O_CREAT) {
54 //return 0;
55 }
56 if (flags & K_O_EXCL) {
57 kdebug("What about exclusive virtual files");
58 }
59 if (flags & K_O_TRUNC) {
60 kdebug("What about truncating a virtual file");
61 }
62 if (flags & K_O_APPEND) {
63 kdebug("What about appending a virtual file");
64 }
65 std::shared_ptr<FsNode> node = Fs::getNodeFromLocalPath(B(""), this->path, true);
66 return this->openFunc(node, flags, this->openData);
67}
68
69U32 FsVirtualNode::getType(bool checkForLink) {
70 if (this->isDirectory()) {

Callers

nothing calls this directly

Calls 4

kdebugFunction · 0.85
BFunction · 0.85
canReadMethod · 0.45
canWriteMethod · 0.45

Tested by

no test coverage detected