Can you produce with a simple example?   if so perhaps open a bug.   This
certainly doesn't happen in the general case so there must be some
interesting thing you are doing.  e.g.

$ cat hello.c
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

int main(int argc, char* argv[]) {
  struct stat buf;
  printf("%d\n", stat("foo", &buf));
  return 0;
}
$ ./emcc  hello.c
$ node ./a.out.js
-1

cheers,
sam

On Mon, Oct 5, 2020 at 2:10 AM Mike Moreton <[email protected]>
wrote:

> From C++, when I call stat() on a file that doesn't exist, I get success
> (i.e. 0) rather than failure (i.e. -1).
>
> The stat structure has st_mode set to zero, though I'm not sure if this is
> the value before the call not being changed, or if it is explicitly zeroed.
>
> Anyone have any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/45f78bba-2bd9-41bd-a9d3-df9d5ef2c605n%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/45f78bba-2bd9-41bd-a9d3-df9d5ef2c605n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CAL_va28Us%3DiN6MRSaNnmYL80A7mSiUD-W_WM-wi5_YnmJ%3DhXSA%40mail.gmail.com.
  • stat() not working Mike Moreton
    • Re: stat() not working 'Sam Clegg' via emscripten-discuss

Reply via email to