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
| 286 | // EISDIR - if it is a directory |
| 287 | // EEXIST - if it is a normal file |
| 288 | int _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 | |
| 301 | struct wasmfs_readdir_state { |
| 302 | int i; |