Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!emory!gatech!mcnc!uvaarpa!haven!ncifcrf!lhc!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: ANSI C /K&R 2nd edition questions,... Keywords: errno.h EPERM, ENOENT, ESRCH, ... Message-ID: <15817@smoke.brl.mil> Date: 12 Apr 91 21:52:01 GMT References: <1991Apr11.234342.6190@milton.u.washington.edu> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 31 In article <1991Apr11.234342.6190@milton.u.washington.edu> rburgess@milton.u.washington.edu (Rick Burgess) writes: >are the "Symbolic constants" (VAX/VMSpeak) EPERM, ENOENT, ESRCH,... which are >defined in errno.h in VMS, and apparently also under the standard dynix >compiler on a machine we have here, are these ANSI standard? No, of course not. The only errno values in the C standard are EDOM and ERANGE. >Neither can I find "access(char *file_spec, int mode);", which is supposed to >be a more elegant way to check the existance and protection on files. The whole idea of protection modes, file owner, etc. is highly operating system specific. access() originated in UNIX, where it seldom does the thing that the application is trying to use it for (just a design botch for the access() semantics, in my opinion). >If there should be a general or common opinion that the 2nd edition of K&R is >not adequate for knowing the ANSI standard, can anyone recommend something >readable/usable? Yes, you should have a copy of the actual standard for reference purposes. There is also a little book out by Brodie and Plauger (if I recall correctly) entitled something like "Standard C", that is pretty good for detailed tutorial purposes. >Should there be recommendations against using access(), is there some kind of >standard convolution with fopen() or something that is recognized as a good >and clear and/or "the way" to do what access would do? Usually you can just try the particular form of access you intend, and take measures based on whether or not it reports an error.