From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!trev!newsfeed.esat.net!nslave.kpnqwest.net!nloc.kpnqwest.net!nmaster.kpnqwest.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Lisp as replacement for python References: <4adwukgxq.fsf@beta.franz.com> <0P9Q7.32220$nm3.1541763@news1.rdc1.bc.home.com> <3216770441744098@naggum.net> <8qhQ7.33479$nm3.1607148@news1.rdc1.bc.home.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3216794239740055@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 47 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 08 Dec 2001 09:57:22 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1007805442 193.71.66.49 (Sat, 08 Dec 2001 10:57:22 MET) NNTP-Posting-Date: Sat, 08 Dec 2001 10:57:22 MET Xref: archiver1.google.com comp.lang.lisp:22099 * Kaz Kylheku | If it's not an executable, it s shunted to the same command interpreter | that the system() function invokes. That interpreter can optionally | process #!, as provided by this text in the shell command language | description:``[I]f the first line of a file of shell commands starts with | the characters #!, the results are unspecified.'' * Erik Naggum > This is incorrect for many systems, probably all reasonably modern > systems. #! is processed by the kernel as just another magic number for > executabies, not by the shell, anymore. * Kaz Kylheku | It's not incorrect, it's only too weak to express what is provided by | actual useful implementations. Those modern systems do conform the | weak spec as written. Treating the #! as a comment is an exemplary | provision of ``unspecified behavior''. Plus there is plenty of | room to interpret what is considered an executable file by the exec*() | functions, which opens the door to magic numbers. I thought the premise for your elaboration was the first sentence. The first sentence is incorrect, since the file has to be executable, but maybe there is a difference between an executable file and an executable. In any case, the followup would be arbitrary. > A better way than all this would be a system call to request the full > path name of one's executable. That, of course, does not exist. > Sometimes, Unix really sucks. | It doesn't exist in any *portable* way. Well, those of us who still have a working memory of better times past remember TOPS-10 and TOPS-20 and their excellent operating system support for this kind of information. | On Linux, for instance, we have a special /proc filesystem section where | you can look up the paths of your memory mappings. Now that you made me look for it (thanks :), I vastly prefer (unix:readlink "/proc/self/exe"). /// -- The past is not more important than the future, despite what your culture has taught you. Your future observations, conclusions, and beliefs are more important to you than those in your past ever will be. The world is changing so fast the balance between the past and the future has shifted.