<https://rawgit.com/Flix01/imgui/2015-10-Addons/examples/addons_examples/html/main.html>
> Looks like our filesystem does create /proc/self/fd.
>
Why ?
Please look at this code:
// File: testrealpath.c
> #include <stdlib.h>
> #include <stdio.h>
> #include <errno.h>
>
> int testrealpath(const char* path) {
> errno = 0;
> char *t_realpath_buf = realpath(path, NULL);
> if (NULL == t_realpath_buf) {
> printf("Resolved failed: \"%s\"\n",path);fflush(stdout);
> perror("Resolve failed");
> return 1;
> } else {
> printf("Resolved: \"%s\"\n", t_realpath_buf);fflush(stdout);
> free(t_realpath_buf);
> return 0;
> }
> }
>
int main(int argc, char **argv)
> {
> // folders
> testrealpath("/");
> testrealpath("/proc");
> testrealpath("/proc/self");
> testrealpath("/proc/self/non-existent");
> testrealpath("/proc/self/fd"); // TypeError: node is
> undefined. Why ?
>
> return 0;
> }
>
>
emcc -o testrealpath.html testrealpath.c
>
firefox testrealpath.html
>
Output:
>
Resolved: "/"
> Resolved: "/proc"
> Resolved: "/proc/self"
> Resolved failed: "/proc/self/non-existent"
> TypeError: node is undefined
>
So I get a TypeError instead of a "Resolved failed".
Beside that if that folder appears in my dialogs, it means that is
"somehow" returned by the "scandir" call with de->d_type==DT_DIR, where de
is a pointer to a dirent struct (I'm using the dirent.h header file).
--
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].
For more options, visit https://groups.google.com/d/optout.