MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / getFile

Method getFile

lib/vfs/machfs.cc:106–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 Bytes getFile(const Path& path) override
107 {
108 HfsMount m(this);
109 if (path.size() == 0)
110 throw BadPathException();
111
112 std::vector<std::shared_ptr<Dirent>> results;
113 auto pathstr = ":" + path.to_str(":");
114 HfsFile file(hfs_open(_vol, pathstr.c_str()));
115 if (!file)
116 throwError();
117
118 AppleSingle a;
119
120 hfsdirent de;
121 hfs_fstat(file, &de);
122 a.creator = Bytes(de.u.file.creator);
123 a.type = Bytes(de.u.file.type);
124
125 hfs_setfork(file, 0);
126 a.data = readBytes(file);
127 hfs_setfork(file, 1);
128 a.rsrc = readBytes(file);
129
130 return a.render();
131 }
132
133 void putFile(const Path& path, const Bytes& bytes) override
134 {

Callers

nothing calls this directly

Calls 8

BadPathExceptionClass · 0.85
hfs_openFunction · 0.85
hfs_fstatFunction · 0.85
hfs_setforkFunction · 0.85
to_strMethod · 0.80
BytesClass · 0.50
sizeMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected