Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!cmcl2!brl-adm!adm!ADLER1%BRANDEIS.BITNET@wiscvm.wisc.EDU From: ADLER1%BRANDEIS.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: C ON VMS Message-ID: <7614@brl-adm.ARPA> Date: Sun, 31-May-87 11:41:44 EDT Article-I.D.: brl-adm.7614 Posted: Sun May 31 11:41:44 1987 Date-Received: Tue, 2-Jun-87 01:48:51 EDT Sender: news@brl-adm.ARPA Lines: 63 I am having a problem with C on VAX/VMS which I could perhaps solve if the DEC documentation were reliable, which it is not. The problem has to do with using C to handle files. To be concrete, consider a program which prompts the user for a character, a string, a sourcefile name and a target file name and then copies the source file one character at a time to the target file except that it replaces every occurrence of the given ccharacter by the given string. This is a pretty simple program to write. In VMS, it performs strangely. For example, suppose I run the program so that it should have no effect, say, change every comma to a comma. The DIFFERENCES command will indicate that the source file and target file are identical but the target file will no longer be in standard text file format even if the source file is. This already shows that stdio is not designed to take the file formatting into account. Now suppose you begin with a file containing a period and run the program to change to period to 10 periods, then take the resulting file and run the program, again changing each period to 10 periods, and so on. Very quickly one gets error messages when one tries to type the resulting files and in some cases I've gotten error messages just from running the program. Again it has to do with the formatting of the file. I asked the system programmer here what to do about it and the reply was to use the other options to the various file handling commands in VAX C. I consulted the manual and found that apart from the usual qualifiers one has in C, one can also specify file attributes which presumably let one control the formatting. This is discussed in Ch. 16 of the VAX C manual and a table of file attributes is given without any explanation of what they mean (well, it hums a few bars but the fat lady doesn't sing). There is a lengthier discussion in Ch. 13 of the VAX C manual as well as a sample program. Because one is not allowed to remove the documentation from the building to xerox and study it, I was obliged to spend a week typing the sample program into a file. When I ran it, I discovered that the program is wrong. For one thing, the type XAB which it uses is never defined in any of the include files in the library. One of the C programmers tried changing XAB to XABKEY and also corrected some typos in the text and the resulting program did compile and run but did not perform correctly. Such errors suggest that DEC did not take the trouble to make sure that the program they printed was actually one that they had run: it is perhaps a copy or an earlier version. I note that their SCAN manual is typeset with Knuth's TEX and the technology exists (e.g. Knuth's WEB or Thimbleby's CWeb) to typeset programs that actually correspond to working versions. So such carelessness in documentation is inexcusable. The material in Ch. 13 of the VAX C manual is based on the RMS of VAX/VMS. Presumably, one can find what one needs to know by reading the RMS manual. However, I am advised that the RMS manual is itself unreliable. The computing center staff says it is not equipped to handle these problems. The logical thing would be to contact DEC and ask for help. However, users are not entitled to call up the toll-free numbers that DEC provides for user support and I am advised both by the computing center staff and by George Robinson, the software specialist at the local DEC office, that there is no help from DEC for the afflicted in the here and now: one's salvation comes in the hereafter when they sell you the next release for plenty. I don't want to spend months doing DEC's laundry. If this is typical of what one can expect from computer manufacturers and sites, I think users are in big trouble. Before starting any project one must know one is starting on solid ground and no one seems to be in the business of selling that.