The code is:
while((c = getopt(argc, argv, "i:o:p"))!=EOF){
switch(c){
case 'i':
strcpy(infile, optarg);
break;
case 'o':
strcpy(outfile, optarg);
break;
case 'p':
page_width = 612.0;
page_depth = 732.0;
break;
}
}
if (strlen(outfile) == 0){
strcpy(outfile, "PD");
strcpy(outfile+2, infile+2);
}
f.fv = 0;
a.av = 0;
f.fs.domain = 3;
f.fs.ascii = 1;
f.fs.designator = 0;
f.fs.format = 0;
f.fs.carriage = 0;
f.fs.label = 0;
f.fs.no_f_equ = 0;
f.fs.type = 0;
a.as.copy = 0;
a.as.access = 0;
infileno=FOPEN(infile, f.fv, a.av, -133);
cc=ccode();
if(cc != CCE){
FCHECK(infileno, &fs);
fprintf(stderr,"Error opening %s (%d)\n", infile, fs);
exit(1);
}
outfilef=fopen(outfile,"w+ Bs");
/* "w Bs Df1" "a+ Bs Df1" ... */
if (outfilef==NULL){
fprintf(stderr,"Error opening %s\n", outfile);
exit(1);
}
...
if(fclose(outfilef)){
fprintf(stderr,"error %d closing %s\n", errno, outfile);
if (errno==ESYSERR){
fprintf(stderr, " intrinsic %d, MPE error %d\n",
_mpe_intrinsic, _mpe_errno);
}
}
FCLOSE(infileno, 0, 0);
> -----Original Message-----
> From: Denys Beauchemin [mailto:[log in to unmask]]
> Sent: Tuesday, October 22, 2002 9:05 AM
> To: Dave Waroff; [log in to unmask]
> Subject: RE: Error closing file in C/iX
>
>
> Is there anything fancy in the filename itself? Better yet,
> please post the
> code that does the fopen, including the details of outfile.
>
>
> Denys...
>
> -----Original Message-----
> From: HP-3000 Systems Discussion
> [mailto:[log in to unmask]]On Behalf Of
> Dave Waroff
> Sent: Tuesday, October 22, 2002 10:51 AM
> To: [log in to unmask]
> Subject: Re: Error closing file in C/iX
>
> The file should be a bytestream file. If i build it, it is
> unchanged. If not, there's no file, permanant or temp.
> There's no problem opening or writing to the file. The group
> (pub) is about half full. No Posix.
>
> Thanks, all
> David Waroff
>
>
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|