Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ucla-cs!zen!ucbvax!KL.SRI.COM!STEINBERGER From: STEINBERGER@KL.SRI.COM.UUCP Newsgroups: comp.os.vms Subject: Warning on fwrite C function Message-ID: <12335430450.32.STEINBERGER@KL.SRI.Com> Date: Thu, 17-Sep-87 18:23:15 EDT Article-I.D.: KL.12335430450.32.STEINBERGER Posted: Thu Sep 17 18:23:15 1987 Date-Received: Sat, 19-Sep-87 10:13:58 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 15 In an earlier message I asked a question about reading/writing binary files from VAX C. After two calls to the DEC CSS, I have found that the description of the arguments to fwrite is not appropriate if one is trying to write a single binary record to a (fixed record size) file opened with the "wb" attribute. The VAX C RTL Ref Man states that the second and third arguments to fwrite are number of items and size of item. This may work for writing to non-binary files. To write one record, the second argument should be the total size in bytes (and equal the record size used in the "mrs=rec_size" argument of fopen), and the third argument should equal 1. The fread function works as advertised on binary files. -Ric Steinberger Steinberger@kl.sri.com -------