MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / getSize

Method getSize

system/lib/wasmfs/backends/node_backend.cpp:108–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107private:
108 off_t getSize() override {
109 // TODO: This should really be using a 64-bit file size type.
110 uint32_t size;
111 if (state.isOpen()) {
112 if (_wasmfs_node_fstat_size(state.getFD(), &size)) {
113 // TODO: Make this fallible.
114 return 0;
115 }
116 } else {
117 if (_wasmfs_node_stat_size(state.path.c_str(), &size)) {
118 // TODO: Make this fallible.
119 return 0;
120 }
121 }
122 return off_t(size);
123 }
124
125 int setSize(off_t size) override {
126 if (state.isOpen()) {

Callers

nothing calls this directly

Calls 3

isOpenMethod · 0.80
getFDMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected