[Info-vax] wrong file format

Arne Vajhøj arne at vajhoej.dk
Wed Dec 30 20:09:29 EST 2020


On 12/30/2020 2:55 PM, Bill Gunshannon wrote:
> On 12/30/20 7:59 AM, Dirk Munk wrote:
>> Suppose I have a file with binary data, and one byte has the binary 
>> (ascii) value of <lf>, then Unix will use it as a record separator, 
>> even if it is in the middle of the actual data of that record.
> 
> Unix has no records. If you cat the file it will line break at the <lf>.
> If you od -c the file it will identify the <lf> as just that.

There is a convention and some library functions that assume
text files consist of LF delimited lines.

>> Suppose you have a VMS file with fixed record size. That file has no 
>> records separators what so ever, it is one long stream of data. VMS 
>> can calculate where the records start and end in the file. Suppose it 
>> consists out of sets of three records of 100 bytes that belong 
>> together. Then you can change the attributes of that file to records 
>> of 300 bytes, and in one read operation you will have all the data 
>> that belongs together. I've actually used this in the past.
> 
> And that would be an application concept, not really an OS thing.

On *nix it is an application thing. But on VMS it is really an
OS thing.

RMS will use the record format and record length when reading.

On *nix it is 300 bytes that can be read as 3 x 100 bytes or
1 x 300 bytes.

But on VMS then 3 records of 100 bytes are different from
1 record of 300 bytes. SYS$GET will behave different in
the two cases.

>> Suppose you want to print such a file, then VMS will send a <cr> and a 
>> <lf> to the printer after each record. Simple.
> 
> VMS won't.  Whatever application actually prints it will.

Something will send the CR LF.

But VMS will actually tell where to put them as SYS$GET calls (or some
language RTL on top of it) will return either 3 lines or 1 line.

Arne



More information about the Info-vax mailing list