Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!aglew%xenurus@gswd-vms.Gould.COM From: aglew%xenurus@gswd-vms.Gould.COM (Andy Glew) Newsgroups: comp.unix.wizards Subject: Re: /bin/test and stat(2) Message-ID: <9838@brl-adm.ARPA> Date: Sun, 18-Oct-87 00:21:45 EDT Article-I.D.: brl-adm.9838 Posted: Sun Oct 18 00:21:45 1987 Date-Received: Sun, 18-Oct-87 13:16:39 EDT Sender: news@brl-adm.ARPA Lines: 60 ..> "" and "." as path elements. I rather like giving equal rights to the empty string (I worship Dijkstra and always right while(1) /*skip*/; instead of while(1);), but the big lossage for the empty string is that (concat "" "/" "subdir") doesn't work. By any rights pathnames beginning with "/" should really be relative pathnames... Obviously the thing to do is to redefine all pathname handling functions to accept vectors of strings, like argv; eg. char *pathv[] = { "", "subdir", (char *)0, }; fd = openb(pathv,O_RDONLY,mode); This has the pleasant effect of permitting "/" as a character in pathnames. Equal rights to slashes, and other strings with criminal tendencies! In fact, we should go even further, and permit nul characters in pathnames by providing a length: #define LS(str) {(sizeof(str)-1),str} struct pathel { int length; char *str; } struct pathel pathv[] = { LS(""), LS("subdir with a null and / in it"), (char *)0, }; But then we're discriminating against null strings, ie. string pointers of value 0. Obviously, need a length on the pathv... And you know, I might seriously be in favour of this if I worked every day in a decent language like LISP, instead of in Stone Age C. Smile, dammit! Andy "Krazy" Glew. Gould CSD-Urbana. USEnet: ihnp4!uiucdcs!ccvaxa!aglew 1101 E. University, Urbana, IL 61801 ARPAnet: aglew@gswd-vms.arpa I always felt that disclaimers were silly and affected, but there are people who let themselves be affected by silly things, so: my opinions are my own, and not the opinions of my employer, or any other organisation with which I am affiliated. I indicate my employer only so that other people may account for any possible bias I may have towards my employer's products or systems.