Both these snippets should fail with notdir because the path contains a trailing slash. This behavior is consistent among Linux host, Wasmtime, WAMR, WasmEdge. Node however, successfully opens the file.
#include <fcntl.h>
#include <stdio.h>
int main() {
int fd = open("file/", O_RDONLY);
if (fd < 0) {
perror("open");
return 1;
}
return 0;
}
Just want to highlight a case this behavior is desired. A symlink may point to a path with trailing slash to make sure it's a directory and not a file.
Both these snippets should fail with
notdir
because the path contains a trailing slash. This behavior is consistent among Linux host, Wasmtime, WAMR, WasmEdge. Node however, successfully opens the file.