ods2reader, some notes

- the sources are from
        http://vms.process.com/ftp/vms-freeware/FREE-VMS/ODS2.TXT
  which really is an email. The source said and still says 'getvms.c'.
  This doesn't really name what it is, an ods2reader. So I changed the name.
  The source indicates another name 'odsrdr', which is still not descriptive
  enough, in my opinion. The email indicates that the source came from Glenn
  C. Everhart. That was in 1996. I don't know of any newer version.
  My minor source code changes for Linux are visible in the diff output.


- usage: ./ods2reader [-t][-n nativdev][-i][-b][-d][-f][-s] vmsfile
        read the specified file from the DFLTDEV (here /dev/cdrom) and
        write it to a local file with same filename, example
                ./ods2reader [JENSEN]LOGIN.COM
        copies the file LOGIN.COM into the current working directory
        (DFLTOUT = disk, DFLTMOD = text)

        -d : output is disk file

        -i : image mode,
             byte by byte, regardless of any record structure, up to EOF

        -I : image mode,
             block by block, regardless of any record structure, up to
             last block

        -l : list directory
             here, `vmsfile' is a directory, a [000000] or [JENSEN.USREXE]
             otherwise:
             [JENSEN.USREXE]ZIP.EXE;1 -- Invalid directory specification

        -n : native device specification (default is /dev/cdrom)
             (although the usage allows a space there is none, the default
              is equivalent to "-n/dev/cdrom")

        -f : equivalent to -d, output is disk file

        -s : output is stdout

        -t : text mode
             record after record, with \n inserted

        -T : text mode
             record after record, with first two bytes removed and \n inserted

        vmsfile: VMS file specification including the directory and a version
             number
             Also a device name can be added. However, this was changed:
             with DFLTDEV #defined it is no longer a device in '/dev'
             it is a local file name. That way both, disk files and devices
             can be accessed, directly or via a symbolic link:
                osf1/ods2reader -l ods2.dsk:[000000]
                ods2.dsk:[000000] -- Bad filename syntax
                ln -s ods2.dsk disk
                osf1/ods2reader -l disk:[000000]
                000000.DIR;1
                BACKUP.SYS;1
                BADBLK.SYS;1
                ...
 
                ln -s my /dev/loop0
                osf1/ods2reader -l my:[000000]
                000000.DIR;1
                BACKUP.SYS;1
                BADBLK.SYS;1
                ...
 
- root is good enough, read permission is required for the device
  the error message does not really say what's wrong:
          ./ods2reader -l [000000]
          [000000] -- Can't open /dev/scd1