From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,47a06d19e281eb8d X-Google-Attributes: gidf7344,public X-Google-Thread: 1164f8,47a06d19e281eb8d X-Google-Attributes: gid1164f8,public X-Google-Thread: f6134,47a06d19e281eb8d X-Google-Attributes: gidf6134,public X-Google-Thread: 111731,47a06d19e281eb8d X-Google-Attributes: gid111731,public X-Google-ArrivalTime: 1994-03-16 16:45:59 PST Xref: gmd.de comp.org.decus:3172 comp.os.vms:42777 comp.sys.dec:14501 comp.unix.advocacy:1304 Path: gmd.de!newsserver.jvnc.net!netnews.upenn.edu!dsinc!spool.mu.edu!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!netline-fddi.jpl.nasa.gov!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.org.decus,comp.os.vms,comp.sys.dec,comp.unix.advocacy Subject: Re: Is VMS Dying? Date: 17 Mar 1994 00:45:59 GMT Organization: HST Wide Field/Planetary Camera Distribution: world Message-ID: <2m8987$f1o@gap.cco.caltech.edu> References: <1994Feb26.204059.4068@mixcom.mixcom.com> <11MAR199400234346@hearts.aces.com> <1994Mar13.135241.18814@avatar.montagar.com>,<2m5qehINNper@jhunix.hcf.jhu.edu> Reply-To: carl@SOL1.GPS.CALTECH.EDU NNTP-Posting-Host: sol1.gps.caltech.edu In article <2m5qehINNper@jhunix.hcf.jhu.edu>, szgyula@skysrv.pha.jhu.edu (Gyula Szokoly) writes: = I might be wrong. You are. =I might be negligant. But once uppon a time I had to =create files, which could be send in a PSI mail over X-25, and it was also =required that a C program using open and tell, Why not use stat() instead? =were able to know the number =of bytes that can be read from the file (in the UNIX picture it's called the =length of the file). I *think* that VMS counted the headers, bookkeeping =info, etc. and added it to the actual length, at least the number was not =correct. VMS didn't count the header. If the record type was variable, it counted the record byte counts; if the record type was either variable or fixed, it counted the one byte of padding added to each odd-length record. =I could not find any file format in VMS that offered these =functionalities. That's a rather remarkable claim, given that the STREAM_LF record type does what you wanted, and that's the default record type for the VAXC RTL. =What I wanted to point out: with my knowledge, with my =practice, I wasn't able to do something that was trivial in UNIX. In that case, your "knowledge" must have been minimal. I.e., you must have been totally clueless, unless you're talking about something done back in, what was it, VMS version 2, I think (or maybe STREAM files weren't introduced until version 4, but I think version 2 was the last version that didn't support them). Consider the following program: #include stdio #include stat main() { char *ptr[] = { "This", "is", "a", "test", 0 } ; char *file = "TEST.DAT"; int nbytes = 0, i; struct stat statblk; FILE *fp; fp = fopen(file, "w"); for(i = 0; ptr[i] != 0; ++i) { fprintf(fp, "%s\n", ptr[i]); nbytes += strlen(ptr[i]) + 1; } fclose(fp); stat(file, &statblk); printf("Wrote %d bytes to file\n", nbytes); printf("stat() says there are %d bytes in file.\n", statblk.st_size); } It produces the output: Wrote 15 bytes to file stat() says there are 15 bytes in file. =It does not mean at all that UNIX is inferior. Unfortunately not everybody =knows everything about VMS. If somebody claims this, he is stupid. I haven't heard anybody make that claim, and given that there are folks like you out there who appear to know NOTHING about VMS, it would, indeed, be stupid to assert that everybody knows everything about VMS. -------------------------------------------------------------------------------- Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL Disclaimer: Hey, I understand VAXen and VMS. That's what I get paid for. My understanding of astronomy is purely at the amateur level (or below). So unless what I'm saying is directly related to VAX/VMS, don't hold me or my organization responsible for it. If it IS related to VAX/VMS, you can try to hold me responsible for it, but my organization had nothing to do with it.