samperi@marob.MASA.COM (Dominick Samperi) (05/22/89)
Is it safe to use stream_lf files (fopen-ed with the "b" option) to store binary files like compressed files, or TeX dvi files? This would make it much easier to port software from UNIX to VMS. Why do many utilities (like DECUS TeX, and PD compress) use 512-byte fixed length records? These questions were motivated by the following observations... I have a version of TeX for VMS that opens the output dvi file using fopen(name, "wb"), so the record format is stream_lf. This seems to work OK, but the dvi files are not compatible with tools from the DECUS TeX package, since these tools assume a dvi file with 512-byte fixed length records. I tried to simply change the open statements to generate 512-byte fixed length record dvi files, but the none of the tools seemed to be satisfied that the resulting dvi file is valid. Now, it seems that the stream files that are generated are not supported properly by some VMS tools. For example, the output of ANAL/RMS when run on one of these stream files is not a pretty sight. Also, the VMS docs seem to indicate that the maximum record size in a stream_lf file is 32K. This would be sufficient motivation to work harder on the conversion to 512-byte fixed length records, except for the fact that records larger than 32K seem to be handled just fine, and the fact that ANAL/RMS chokes does not seem to matter. I did an experiment where I opened a file with fopen(name, "wb"), and then wrote 128 1Kbyte buffers of data, with no LF's, and I was able to read back the data fine (in spite of the fact that ANAL/RMS chokes on the output file). -- Dominick Samperi -- ESCC samperi@marob.masa.com uunet!hombre!samperi