Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!adm!DERMOTT@DREA-XX.arpa From: DERMOTT@DREA-XX.arpa (Dave Dermott) Newsgroups: comp.lang.c Subject: vax-c problem Message-ID: <10555@brl-adm.ARPA> Date: Thu, 26-Nov-87 09:18:45 EST Article-I.D.: brl-adm.10555 Posted: Thu Nov 26 09:18:45 1987 Date-Received: Sun, 29-Nov-87 16:16:20 EST Sender: news@brl-adm.ARPA Lines: 47 Bug (or feature?) in VAX C v2.3 I am porting a program from UNIX that uses fwrite to a binary file .On VMS the file must be 512 byte fixed format. I'm having trouble with the fwrite function when writing to fixed length 512 byte records. It doesn't write anything. Simple example: #includechar buffer[512]; main() { int i,j; FILE *fp; for (i=0;i<512;i++)buffer[i]=i; fp=fopen("testfix.dat","w","rfm=fix","mrs=512"); fwrite(buffer,1,512,fp); fclose(fp); } After running this program I check the output file with: $DIR/FULL TESTFIX.DAT TESTFIX.DAT;11 File ID: (9143,24,0) Size: 0/0 Owner: [MATH,DERMOTT] Created: 21-NOV-1987 21:03 Revised: 21-NOV-1987 21:03 (1) Expires: Backup: File organization: Sequential File attributes: Allocation: 0, Extend: 0, Global buffer count: 0, No version limit Record format: Fixed length 512 byte records Record attributes: None Journaling enabled: None File protection: System:RWED, Owner:RWED, Group:RWED, World:RE Access Cntrl List: None I.E. the file is empty! If I invert the 2nd and 3rd arguments it does write 512 bytes. i.e. fwrite(buffer,512,1,fp); Am I doing something wrong? David Dermott DERMOTT@DREA-XX.ARPA Dartmouth Nova Scotia Canada -------