Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!decvax!decwrl!ucbvax!YALE.ARPA!LEICHTER-JERRY From: LEICHTER-JERRY@YALE.ARPA.UUCP Newsgroups: mod.computers.vax Subject: Re: problem with C fopen(), file revision date Message-ID: <8606051013.AA09107@ucbvax.Berkeley.EDU> Date: Thu, 5-Jun-86 06:13:54 EDT Article-I.D.: ucbvax.8606051013.AA09107 Posted: Thu Jun 5 06:13:54 1986 Date-Received: Thu, 5-Jun-86 20:42:44 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Organization: The ARPA Internet Lines: 36 Approved: info-vax@sri-kl.arpa The following program behaves curiously. When you run it, the revision, date of the file it opens is updated, if that file is a stream_lf file., If the file is variable length or fixed length, the revision date is not, updated. This even occurs when the file protection is (s,o,g,w:r), and the file is on a directory which is not mine. Any explanations? #include main(argc, argv) int argc; char **argv; { FILE *inf; char line[BUFSIZ]; argc--; argv++; if ( (inf = fopen(*argv, "r")) != NULL) puts("Opened"); else puts("Can't open"); } The VAX C RTL has to do some strange hacking to make stream files work right. (Long story. Basically, as far as RMS is concerned, stream files are just as record oriented as other files, so you can't position to arbitrary bytes. But C requires that you be able to do this. So the C RTL ignores RMS and does block I/O, which sometimes requires fixing up the file header - which is why stream files don't work quite right over DECnet, and probably ultimately is why this program acts as it does.) Apparently there are some changes in VMS V4.4, which has a new version of the C RTL - try it and see what happens. -- Jerry -------