[Info-vax] wrong file format

1tim....@gmail.com 1tim.lovern at gmail.com
Wed Jan 6 18:33:59 EST 2021


On Wednesday, December 30, 2020 at 7:13:52 AM UTC-7, hb wrote:
> On 12/30/20 1:59 PM, 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.
> No. Unix does not know what a record separator is. It's the application 
> which knows what's in a file and whether an <lf> is a newline and 
> interpreted as a record separator or just data. And, if you have binary 
> data you usually do not read with fgets() or any other read function, 
> which stops reading after a newline.
> > 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.
> You obviously had even record size and never had the record attribute 
> BLOCK_SPAN set to "no" (FDL syntax).


that is because the philosophy of Unix, at least in the early days, was to treat everything as a stream. This made the I/O the same for files, devices, whatever. At the time it was pretty elegant. You had a unified view of the world.  VMS and other operating systems took a different approach and differentiated between files and devices. They also wanted a presence in the commercial space, so the idea of using ISAM as the native file system made a lot of sense. Having the OS know about file structures made applications easier to play together.

Unix makes every application have to know about the metadata for a file, VMS manages the metadata for you.  You can discover all kinds of things about a file simply by asking VMS to open the file and fill in all the data structures, FAB, XAB, etc.  Unix will tell you if you opened the file and if you hit the end of the file.



More information about the Info-vax mailing list