ken@CIT-Hamlet.ARPA (08/29/85)
Has anyone been able to get the "ctx=bin" argument to open()
as documented on page 18-5 of the C run-time library manual to work?
I just get ACCVIOs from the open() when I give this argument. Example:
#include <stdio.h>
-ken adelman
caltech
#ifdef vms
#include <file.h>
#else
#include <sys/file.h>
#endif
/* Test DEC stdio to see if it's really translating ^J -> ^M */
main()
{
int fd;
FILE *fp;
fd = open("FOO.LIS", O_RDWR|O_CREAT, 0644, "ctx=bin");
if (fd == -1) {
printf("open failed\r\n");
exit(-1);
} else
printf("open succeeded, fd is %d\n", fd);
fp = fdopen(fd, "w");
if (fp == NULL) {
printf("fdopen failed\r\n");
exit(-1);
} else
printf("fdopen succeeded, fp is 0x%x\n", fp);
fprintf(fp, "This should work\rMore foo\r\n");
exit(1);
}