VMS C & records in files

Larry Jones scjones at sdrc.UUCP
Fri Aug 19 07:20:45 AEST 1988


In article <1609 at edison.GE.COM>, rja at edison.GE.COM (rja) writes:
> I'm not aware of any solution to the problem of VMS file types.  The
> problem is precisely that VMS is so record-oriented.  Even nominal 
> text files don't work like UNIX.  We find that we have to use a loop of
> successive calls to read() to fill (for example) a 512 byte buffer
> because it gives only 1 record at a time even though you asked for 512
> bytes. :-(
>   UNIX and even MS-DOS will let you read 512 bytes in a chunk so it's VMS
> that is brain-damaged in this case.
> 
>   If anyone hears of a SOLUTION to this problem with VMS C, please e-mail
> me the details.

The solution is to use STANDARD io instead of system-dependent calls like
read.  If you use fread instead of read all works wonderfully.

----
Larry Jones                         UUCP: uunet!sdrc!scjones
SDRC                                      scjones at sdrc
2000 Eastman Dr.                    BIX:  ltl
Milford, OH  45150                  AT&T: (513) 576-2070
Nancy Reagan on superconductivity: "Just say mho."



More information about the Comp.lang.c mailing list