home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / latrobe / uv / vmsflx.arc / VMSFLX.DOC next >
Text File  |  1986-10-31  |  19KB  |  466 lines

  1.  
  2.          
  3.                VMSFLX Version 0.11 - A VMS to MSDOS Copy Program
  4.  
  5.                         Author: Kris K. Barker
  6.                         Copywrite 1986         
  7.                        
  8.          
  9.          VMSFLX is a program that allows you to copy files to and from
  10.          MSDOS floppies on a VMS system (typically a MicroVAX).  To run the
  11.          program, simply:
  12.  
  13.  
  14.          1) Define VMSFLX as a foreign command:
  15.  
  16.              VMSFLX :== device:[directory]VMSFLX
  17.  
  18.          2) Run the program:
  19.  
  20.         VMSFLX [initial_command]
  21.          
  22.  
  23.          Version 0.11 changes:
  24.          
  25.              o  Fixed a bug in the fix introduced by version 0.10
  26.                 with garbage at the end of text files.
  27.          
  28.              o  Added .LIS, .LSP, .OPS, and .RNO as known text file
  29.                 extensions
  30.          
  31.              o  Added code to check for squeezed file extensions
  32.                 (second character of extension is 'Q')
  33.  
  34.         o  Fixed code that determines file type - now strips off
  35.            directory portion of VMS file specs prior to searching
  36.              for extension
  37.          
  38.                   
  39.          VMSFLX commands are as follows:
  40.  
  41.          MOUNT drive
  42.          
  43.                  This command requests the program to mount the
  44.                  specified drive (for example, DUA1:).  Once a
  45.                  drive is mounted, it must be dismounted
  46.                  prior to mounting another drive.
  47.          
  48.              DISMOUNT
  49.          
  50.                  This command dismounts the currently mounted drive.
  51.                  If changes have been made to the directory and
  52.                  file allocation table, these are written to the
  53.                  disk prior to dismounting it.
  54.          
  55.              DISMOUNT/NOWRITE
  56.          
  57.                  This command dismounts the currently mounted drive,
  58.                  however, no directory/fat changes are written to
  59.                  the disk.  This is useful if you have deleted/
  60.                  cleared a disk accidently.
  61.  
  62.         UPDATE
  63.  
  64.             This command writes the internal copy of the fat
  65.             and directory blocks back to the disk.  It is
  66.             essentially the same as a DISMOUNT function, however,
  67.             the disk is left mounted.  It can be used prior to
  68.             a DUMP DIR or DUMP FAT request to insure that the
  69.             disk copy of the fat and directory are up to date.
  70.          
  71.              READ [/LOG] [/CONFIRM] [/TEXT] [/BINARY] [/CONTROL_Z]
  72.                                  in_file [out_file]
  73.          
  74.                  This command reads in_file from the MSDOS floppy
  75.                  and writes it to out_file on the VMS system.
  76.                  If no out_file is specified, it will
  77.                  be named the same as the input file.  VMSFLX uses
  78.                  a table of known file extensions to determine the
  79.                  file type (either text or binary).  To override
  80.                  default operation, use /TEXT to explicitly read
  81.                  a text file or /BINARY for a binary file.  Any
  82.                  file whose extension is not in the known extension
  83.                  table is read in binary mode.  This default is
  84.                  SETtable with the SET TEXT or SET BINARY command.
  85.                  If /CONTROL_Z is specified, the file will be read
  86.                  until a control-z is encountered, then closed.
  87.          
  88.              WRITE [/LOG] [/CONFIRM] [/TEXT] [/BINARY] in_file [out_file]
  89.          
  90.                  This command reads in_file from the VMS system
  91.                  and writes it to out_file on the MSDOS floppy.
  92.                  If no out_file is specified, it will
  93.                  be named the same as the input file.  VMSFLX uses
  94.                  a table of known file extensions to determine the
  95.                  file type (either text or binary).  To override
  96.                  default operation, use /TEXT to explicitly write
  97.                  a text file or /BINARY for a binary file.  Any
  98.                  file whose extension is not in the known extension
  99.                  table is read in binary mode.  This default is
  100.                  SETtable with the SET TEXT or SET BINARY command.
  101.  
  102.              DIR [/FAT] [filespec]
  103.          
  104.                  This command displays a directory of the requested
  105.                  files on the MSDOS disk.  If /FAT is specified,
  106.                  the chain of clusters allocated to each file is
  107.                  also displayed.
  108.          
  109.              FAT
  110.          
  111.                  This command dumps the File Allocation Table, 10
  112.                  FAT entries per line.
  113.  
  114.              DUMP [first_block] [last_block]
  115.          
  116.                  This command displays the contents of the
  117.                  specified blocks on the screen.  The program keeps
  118.             track of a default block.  If no block is specified,
  119.             the default will be incremented and dumped.
  120.  
  121.         DUMP/DIR or DUMP/FAT
  122.  
  123.             This command dumps the directory or fat blocks in
  124.             dump format.  Note that if you have made modifications
  125.             to the disk (i.e. WRITEs, DELETEs, CLEARs, etc.) these
  126.             will not be reflected in this dump as the actual blocks
  127.             on the disk are read.
  128.          
  129.              INITIALIZE [/LABEL=label] [/FULL]
  130.          
  131.                  This command clears the in-memory copy of the FAT
  132.                  and directory (i.e. essentially initializing the
  133.                  directory structure on the disk if the FAT and
  134.                  directory are written out).  /LABEL allows you to
  135.             specify a disk label.  If /FULL is specified, all
  136.             the data blocks on the disk will be cleared.  Note
  137.                  that since /FULL this actually writes the disk,
  138.                  (data area only) DISMOUNT/NOWRITE won't do you much
  139.                  good as the files will still be in the directory
  140.                  but the data will be gone from the disk.
  141.  
  142.             NOTE: /LABEL is NOT currently implemented.
  143.          
  144.         DELETE [/LOG] [/CONFIRM] file_specificaion
  145.  
  146.             This command deletes the specified file or
  147.                  files from the MSDOS disk.
  148.          
  149.          TYPE [/CONTROL_Z] filename
  150.  
  151.             This command TYPEs (to the screen) the requested
  152.             file from the MSDOS disk.  Note: it is up to you
  153.             to make sure the file is ASCII!
  154.                  If /CONTROL_Z is specified, the file will be read
  155.                  until a control-z is encountered, then closed.
  156.          
  157.         SHOW
  158.  
  159.             This command displays the current program status
  160.             including whether or not a drive is mounted and the
  161.             states of the vmsflx$status and vmsflx$binary flags.
  162.  
  163.         SET [[NO]STATUS|[NO]BINARY|[NO]TEXT|[NO]CONTROL_Z]
  164.  
  165.             This command sets (or resets) two flags in the
  166.             program.  SET STATUS sets the vmsflx$status flag;
  167.             a status message will be displayed for all read,
  168.             write, and delete functions (note that /[NO]LOG
  169.             overrides the current vmsflx$status flag setting
  170.             for a given read, write, or delete).  SET BINARY
  171.             sets the vmsflx$binary flag and tells the program
  172.             that all files whose extentions are not known are
  173.             to be assumed binary files for READ and WRITE.
  174.             SET TEXT is equivalent to SET NOBINARY.  The
  175.                  CONTROL_Z flag indicates the default detection of
  176.                  control-z as EOF for READ and TYPE commands.
  177.  
  178.         SCRIPT filename
  179.  
  180.             This tells the program to begin reading commands
  181.             from the specified (script) file.  Commands are
  182.             echoed as they are read.  Script files can contain
  183.             any legal VMSFLX command including other script
  184.             commands.  Currently, scripts can be nested up to
  185.             10 levels deep.  An EXIT command from within a script
  186.             file exits the VMSFLX program without completing
  187.             processing of any higher script files.
  188.  
  189.         ATTRIBUTE [/LOG] [/CONFIRM] [/[NO]SYSTEM] [/[NO]HIDDEN]
  190.               [/[NO]ARCHIVE] [/[NO]READ_ONLY] file_specification
  191.  
  192.             This command allows you to set/reset attributes
  193.                  for a file or files on an MSDOS disk.
  194.  
  195.         SORT
  196.  
  197.             This command resorts the MSDOS disk directory by
  198.             filename.  It also sets the modified flag so that
  199.             on DISMOUNT or EXIT the directory is updated on the
  200.             disk.  (Note: I originally had SORT as a settable
  201.             option forcing the sort on each WRITE or DELETE.  The
  202.             problem was it seemed that it was a bit too much
  203.             overhead to sort all the time so I settled on a
  204.             single SORT command instead.  If enough people would
  205.             like this the other way, let me know).
  206.  
  207.              HELP
  208.          
  209.                  This command displays a brief help screen
  210.                  describing each command.
  211.  
  212.              ^Z or <EXIT> or EXIT
  213.          
  214.                  This command exits the program.  If a disk is
  215.                  currently mounted, and implied DISMOUNT is done
  216.                  (note that if you don't want the directory/fat
  217.                  updated, make sure you DISMOUNT/NOWRITE first).
  218.              
  219.  
  220.      Other notes/comments:
  221.      =====================
  222.  
  223.          1) There is no support for subdirectories on the MSDOS floppy.
  224.          This means that you can only read from or write to files in the
  225.          root directory.
  226.          
  227.          2) There is only minimal checking for legal filenames on both the
  228.          VMS and MSDOS sides.  Long filenames (greater than 8+3 characters)
  229.          get truncated before being written, however, there is no check for
  230.          legal characters.  Also, the program does a simple check for a ']'
  231.          character for an input file specification on a write and strips
  232.          off any directory portion if the output file specification is
  233.          defaulted.
  234.          
  235.          3) The program is written in VAXELN Pascal so you'll need to have
  236.          VAXELN on your system if you want to make any changes.  As with
  237.          most programs, this was kind of a "quick-and-dirty" thing so don't
  238.          expect SDC-ready stuff when you look thru the source.
  239.  
  240.          4) Some very interesting things happen if you try to WRITE a text
  241.          file in binary mode (which is the default mode if the file
  242.          extension is not found in VMSFLX's table).  Pascal will only read
  243.          one record per block (i.e. one line of your text file) and you'll
  244.          get one block per line on the disk (obviously not the desired
  245.          results).  Until I put the code in to check the VMS file
  246.          attributes, make sure you know what you are doing.  Note that I've
  247.          tried to put all the standard extensions in the table so,
  248.          hopefully, all should be well.
  249.  
  250.          5) A known problem: the program does not handle writes of binary
  251.          files with fixed length records.  Under EPascal, I don't have a
  252.          good way of obtaining file characteristics prior to opening the
  253.          file.  I've found most binary files to have variable length
  254.          records and, therefore, I open them up as files of varying_string.
  255.          Unfortunately, the open blows away when the file has fixed length
  256.          records.  I got around this for several files with fixed length
  257.          records by editing the file (with TPU) and making a non-
  258.          destructive change (such as deleting then undeleting a character)
  259.          so TPU would update the output file.  The new file has variable
  260.          length records and all works fine (I did a read on the new file
  261.          and the same one copied onto the floppy by a Rainbow and DIFFed
  262.          the two - no differences were found).
  263.  
  264.          
  265.          I'd be very interested to know what other features people would
  266.          like to see in this program.  I am definitely planning on the    
  267.          following:
  268.          
  269.              1) Maintaining file dates across transfers
  270.              2) Support for MSDOS directories
  271.         
  272.          Please let me know what else you'd like to see.
  273.  
  274.          I've also been asked to convert the program to VAX Pascal.  I will
  275.          probably do this eventually; I don't have an up-to-date manual set
  276.          for VAX Pascal yet (and besides, I'm much more familiar with
  277.          EPascal which has some features I use that aren't available in VAX
  278.          Pascal), but I've got one on order.
  279.  
  280.          I've included the revision history from the program to assist you
  281.          in knowing what changes have been made.  Comments (positive and
  282.          negative) are welcome.
  283.          
  284.          
  285.                          Kris DECWET::Barker
  286.          
  287. ================================================================================
  288. {++
  289. {
  290. { Revision history:
  291. {
  292. {    Version        Date        Modification
  293. {
  294. {    0.1        6-June-1986    Original
  295. {
  296. {    0.2        11-June-1986    Added code to make_name to mask
  297. {                        filenames to 7 bit characters
  298. {                    Added counters for free directory
  299. {                        entries and free clusters and
  300. {                        code to display these values on
  301. {                        DIR commands
  302. {                    Fixed bug in output filename for
  303. {                        reads and writes (outfile was
  304. {                        not '', but rather, left over
  305. {                        from previous call)
  306. {            13-June-1986    Added DELETE and TYPE commands as
  307. {                        well as HELP text to explain them
  308. {            16-June-1986    Fixed bug in process_disk_write -
  309. {                        search was on infile, not outfile
  310. {                        (filename on MSDOS disk)
  311. {                    Added SYS$SETPRV call to give LOG_IO
  312. {                        privilege
  313. {                    Added SYS$MOUNT and SYS$DISMOU calls
  314. {                        to mount and dismount requested
  315. {                        disk
  316. {                    Added HELP text listing known file
  317. {                        extensions
  318. {
  319. {    0.3        17-June-1986    Fixed process_disk_write for binary
  320. {                        files; it was writing out one
  321. {                        too many blocks (all blocks written
  322. {                        once EOF is hit)
  323. {                    Fixed cosmetic bug in dump_fat that
  324. {                        was outputting an extra line with
  325. {                        no fat data
  326. {                    Added MOUNT command to mount a disk
  327. {                     Added DISMOUNT and DISMOUNT/NOWRITE
  328. {                        commands to dismount disks (with
  329. {                        and without directory/fat updating)
  330. {                    Added STATUS command to display current
  331. {                        disk status
  332. {                    Updated HELP screen for new commands
  333. {                    Modified error_message so it ouputs
  334. {                        a VMS-looking error string
  335. {                    Modified clear_disk to check for
  336. {                        (and leave alone) fat entries for
  337. {                        bad blocks
  338. {                    Added some strategically-placed
  339. {                        WRITELNs to improve display
  340. {            20-June-1986    Added TEST function to run thru a
  341. {                        test disk
  342. {
  343. {    0.4        23-June-1986    Modified process_disk_write - binary
  344. {                        files now opened as files of
  345. {                        varying_string(32767) rather than
  346. {                        assuming all were fixed 512-byte
  347. {                        records (which they weren't)
  348. {                    Modified process_disk_read to write
  349. {                        binary files to VMS as file of
  350. {                        varying_string(512) so last record
  351. {                        is the correct length
  352. {
  353. {    0.4A        23-June-1986    Added external declarations of
  354. {                        lib$find_file and lib$find_file_end
  355. {               24-June-1986    Fixed bug in process_disk_write (I had
  356. {                        left an if check on text files that
  357. {                        caused disk_string to not get
  358. {                        initialized for binary files)
  359. {
  360. {    0.5        24-June-1986    Added SET command and changed STATUS to
  361. {                        SHOW (updating HELP accordingly);
  362. {                        SET allows setting of default file
  363. {                        type and whether or not a message
  364. {                        displayed during reads and writes
  365. {                        (code also added to process_disk_
  366. {                        read/write to handle this).
  367. {                    Added crude script processing support;
  368. {                        @filename reads commands from file
  369. {                        until EOF is seen
  370. {            25-June-1986    Added check to disallow attempted
  371. {                        nesting of script files
  372. {                    Added some procedure/function comments
  373. {                    Modified directory display to include
  374. {                        date and attributes (and modified
  375. {                        directory_entry type to support
  376. {                        this)
  377. {                    Added ATTRIBUTE command which allows
  378. {                        setting/resetting of read-only,
  379. {                        hidden, system, and archive bits
  380. {                        in file attribute
  381. {                    Added SORT function to sort directory
  382. {                        (note: this was originally a set
  383. {                        option, but resorting on each write
  384. {                        seemed a bit slow)
  385. {                    Added DIR and FAT keywords to DUMP
  386. {                        command to dump directory and fat
  387. {                        directly from disk (note: may not
  388. {                        be updated!)
  389. {             26-June-1986    Added UPDATE command to write out
  390. {                        directory and fat blocks if disk
  391. {                        has been modified
  392. {    0.6        3-July-1986    Modified command input to use
  393. {                        CLI$DCL_PARSE/CLI$DISPATCH, etc.
  394. {                        in conjunction with a command
  395. {                        table
  396. {            7-July-1986    Added process_script routine (SCRIPT
  397. {                        command) to process a script file
  398. {                        (needed since @filename doesn't
  399. {                        work with DCL_PARSE)
  400. {                    Added call to lib$get_foreign to
  401. {                        process initial command line
  402. {                    Added process_exit (EXIT command) to
  403. {                        allow script files to exit program
  404. {                    Modified script support for nested
  405. {                        scripts
  406. {                    Modified sort_directory to skip over
  407. {                        label and system files at beginning
  408. {                        of disk
  409. {                    Added vmsflx$default_block to keep
  410. {                        default starting block number; DUMP
  411. {                        with no arguments now just dumps
  412. {                        the next block
  413. {            8-July-1986    Misc. fixes to dump_block and
  414. {                        sort_directory
  415. {
  416. {    0.7        9-July-1986    Fixed status message on reads and
  417. {                        writes so drive and filename have
  418. {                        a ':' between them
  419. {            10-July-1986    Removed convert calls (replaced with
  420. {                        internal routines) to eliminate
  421. {                        references to any ELN$ routines
  422. {                        (so others can relink without
  423. {                        having EPascal RTL)
  424. {
  425. {    0.8        10-July-1986    Added code to process_disk_write to
  426. {                        support wildcarded filespecs
  427. {                        on the VMS side
  428. {                    Modified sort_directory - label isn't
  429. {                        necessarily first, just system
  430. {                        files
  431. {                    Modified calls to error_message to
  432. {                        include filespecs where appropriate
  433. {                    Added code to process_disk_read to
  434. {                        support wildcarded filespecs
  435. {                        on the MSDOS side including a
  436. {                        general file-matching routine
  437. {            11-July-1986    Fixed match_file routine
  438. {                    Added support for filename designation
  439. {                        on DIR command
  440. {                    Added support for wildcard filespec
  441. {                        on DELETE command
  442. {                    Added status ('deleting file') to
  443. {                        DELETE when vmsflx$set_status is
  444. {                        true
  445. {                    Added wildcard support to ATTRIBUTE
  446. {                        command and changed syntax (now
  447. {                        command qualifiers are used to
  448. {                        set/clear attribute bits)
  449. {                    Added /CONFIRM and /LOG qualifiers
  450. {                        to READ, WRITE, ATTRIBUTE,
  451. {                        and DELETE commands
  452. {                    Changed OPEN call for READ command
  453. {                        so carriage control is none for
  454. {                        binary files
  455. {
  456. {    0.9        16-July-1986    Added SETtable control_z flag to force
  457. {                        reads to terminate on ^Z (also
  458. {                        added this qualifier to READ and
  459. {                        TYPE commands)
  460. {
  461. {    0.10        21-July-1986    Modified logic in read_disk_file to
  462. {                        accurately terminate file reads
  463. {                        (now computes # of bytes in last
  464. {                        block and checks)
  465. {--}
  466.