From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: fee84,c53c4e194e029536,start X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,c53c4e194e029536,start X-Google-Attributes: gidf678f,public From: Aleksandar Milivojevic Subject: realpath function seems to be broken Date: 1997/01/26 Message-ID: #1/1 X-Deja-AN: 212351738 distribution: world sender: alex@bjesomar.srce.hr g"y?n@z7z))\er6cfis*onx4ol_hkc9dut>?({p8.#@5ci&bk(x7=hac`!yq=sqic$u?jok_-7: Rs{ content-type: text/plain; charset=ISO-8859-2 x-face: *kq/QhAP%!E|K_[kn%b8(4DeLb/J:l;`0!r%cI,)HEDHm4)#<`?.fyPQ+/yYFd*NghB[%8M organization: SRCE x-url: http://jagor.srce.hr/~alex/ mime-version: 1.0 newsgroups: comp.unix.osf.osf1,comp.unix.osf.misc realpath function in Digital UNIX 4.0a seem to be broken. Sometimes it fails to resolve symbolic links. For example, the following program: ===== 8< Begin: a.c 8< ===== #include #include main(int argc, char **argv) { char a[50]; if (realpath(argv[1], a)) printf("Resolved `%s' to `%s'.\n", argv[1], a); else { perror("realpath"); printf("Failed to resolve `%s' (returned `%s').\n", argv[1], a); } } ===== 8< End: a.c 8< ===== when comiled with "cc a.c" gives: == 8< == 8< == 8< == 8< == bjesomar$ ls -ld /bin /var/spool /usr/spool lrwxrwxrwx 1 root system 7 Aug 27 19:22 /bin -> usr/bin lrwxrwxrwx 1 root system 12 Aug 27 19:26 /usr/spool -> ../var/spool drwxr-xr-x 8 root system 8192 Nov 24 16:54 /var/spool bjesomar$ ./a.out /bin Resolved `/bin' to `/usr/bin'. bjesomar$ ./a.out /usr/spool realpath: No such file or directory Failed to resolve `/usr/spool' (returned `var'). bjesomar$ ./a.out /var/spool Resolved `/var/spool' to `/var/spool'. == 8< == 8< == 8< == 8< == If anybody noticed that (s)he can't read e-mail with Gnus in XEmacs, well, the buggy OSF realpath is to be blamed... -- Aleksandar Milivojevi� http://jagor.srce.hr/~alex/ e-mail: alex@srce.hr ================================ooooO=Ooooo============================== "I believe OS/2 is destined to be the most important operating system, and possibly program, of all time." -- Bill Gates, OS/2 Programmer's Guide foreward, 1987