[Info-vax] proper format for JPEG files

Jan-Erik Soderholm jan-erik.soderholm at telia.com
Fri Jul 29 02:48:05 EDT 2011


Jose Baars wrote 2011-07-29 00:47:
> Op 7/27/2011 10:25 PM, Mark Berryman schreef:
>
>> Both are valid although a poorly coded program can choke on either one.
>> I've seen a number of Unix utilities that were simply compiled, not
>> ported, on VMS that choke on the first format. Anything that uses RMS
>> $GET code will choke on the second.
>> Any program you have for reading JPEG files is likely written in C. The
>> CRTL uses block-mode I/O and does its own internal buffering. For C
>> programs, it all depends on how the file is opened. There are a number of
>> permutations that work. For me, the easiest is to use "ctx=rec" if I
>> expect to be reading records (it doesn't matter if the file is a stream
>> format or a variable record format) or "ctx=stream" if I am reading
>> binary data. Using "ctx=stream" will read raw data regardless of the file
>> format.
>> RMS assumes records. If you wish to read non-record oriented data using
>> RMS, the file format must either be fixed-length records or you must use
>> RMS block I/O.
>>
>
> Thanks, that is clear. A universal read routine that doesn't know what to
> expect needs to have decision logic built in on how to properly open the
> file, where most software can get away with a choice in advance, based on
> the functionality (an editor will use record mode, an image processing
> program block i/o), or even make do with the file type.
>
> The decision logic is not simple, probably one of the reasons that Apache
> and sftp have or had restrictions on the file formats that were supported.
>

Isn't it more that where such things like Apache come from, you do not
have to decide anything, there is only one file/record format.

Software like OSU and WASD, on the other hand, that was originaly
written for OpenVMS in the first place, might have "batter" support
for the different file/record formats available.


> I haven't seen programs choking on reading binary fix 512 files
> though. How would that happen?




More information about the Info-vax mailing list