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

Function _wasmfs_identify

system/lib/wasmfs/js_api.cpp:288–299  ·  view source on GitHub ↗

Helper method that identifies what a path is: ENOENT - if nothing exists there EISDIR - if it is a directory EEXIST - if it is a normal file

Source from the content-addressed store, hash-verified

286// EISDIR - if it is a directory
287// EEXIST - if it is a normal file
288int _wasmfs_identify(const char* path) {
289 struct stat file;
290 int err = 0;
291 err = stat(path, &file);
292 if (err < 0) {
293 return ENOENT;
294 }
295 if (S_ISDIR(file.st_mode)) {
296 return EISDIR;
297 }
298 return EEXIST;
299}
300
301struct wasmfs_readdir_state {
302 int i;

Callers

nothing calls this directly

Calls 1

statClass · 0.70

Tested by

no test coverage detected