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 >
Wrap
Text File
|
1986-10-31
|
19KB
|
466 lines
VMSFLX Version 0.11 - A VMS to MSDOS Copy Program
Author: Kris K. Barker
Copywrite 1986
VMSFLX is a program that allows you to copy files to and from
MSDOS floppies on a VMS system (typically a MicroVAX). To run the
program, simply:
1) Define VMSFLX as a foreign command:
VMSFLX :== device:[directory]VMSFLX
2) Run the program:
VMSFLX [initial_command]
Version 0.11 changes:
o Fixed a bug in the fix introduced by version 0.10
with garbage at the end of text files.
o Added .LIS, .LSP, .OPS, and .RNO as known text file
extensions
o Added code to check for squeezed file extensions
(second character of extension is 'Q')
o Fixed code that determines file type - now strips off
directory portion of VMS file specs prior to searching
for extension
VMSFLX commands are as follows:
MOUNT drive
This command requests the program to mount the
specified drive (for example, DUA1:). Once a
drive is mounted, it must be dismounted
prior to mounting another drive.
DISMOUNT
This command dismounts the currently mounted drive.
If changes have been made to the directory and
file allocation table, these are written to the
disk prior to dismounting it.
DISMOUNT/NOWRITE
This command dismounts the currently mounted drive,
however, no directory/fat changes are written to
the disk. This is useful if you have deleted/
cleared a disk accidently.
UPDATE
This command writes the internal copy of the fat
and directory blocks back to the disk. It is
essentially the same as a DISMOUNT function, however,
the disk is left mounted. It can be used prior to
a DUMP DIR or DUMP FAT request to insure that the
disk copy of the fat and directory are up to date.
READ [/LOG] [/CONFIRM] [/TEXT] [/BINARY] [/CONTROL_Z]
in_file [out_file]
This command reads in_file from the MSDOS floppy
and writes it to out_file on the VMS system.
If no out_file is specified, it will
be named the same as the input file. VMSFLX uses
a table of known file extensions to determine the
file type (either text or binary). To override
default operation, use /TEXT to explicitly read
a text file or /BINARY for a binary file. Any
file whose extension is not in the known extension
table is read in binary mode. This default is
SETtable with the SET TEXT or SET BINARY command.
If /CONTROL_Z is specified, the file will be read
until a control-z is encountered, then closed.
WRITE [/LOG] [/CONFIRM] [/TEXT] [/BINARY] in_file [out_file]
This command reads in_file from the VMS system
and writes it to out_file on the MSDOS floppy.
If no out_file is specified, it will
be named the same as the input file. VMSFLX uses
a table of known file extensions to determine the
file type (either text or binary). To override
default operation, use /TEXT to explicitly write
a text file or /BINARY for a binary file. Any
file whose extension is not in the known extension
table is read in binary mode. This default is
SETtable with the SET TEXT or SET BINARY command.
DIR [/FAT] [filespec]
This command displays a directory of the requested
files on the MSDOS disk. If /FAT is specified,
the chain of clusters allocated to each file is
also displayed.
FAT
This command dumps the File Allocation Table, 10
FAT entries per line.
DUMP [first_block] [last_block]
This command displays the contents of the
specified blocks on the screen. The program keeps
track of a default block. If no block is specified,
the default will be incremented and dumped.
DUMP/DIR or DUMP/FAT
This command dumps the directory or fat blocks in
dump format. Note that if you have made modifications
to the disk (i.e. WRITEs, DELETEs, CLEARs, etc.) these
will not be reflected in this dump as the actual blocks
on the disk are read.
INITIALIZE [/LABEL=label] [/FULL]
This command clears the in-memory copy of the FAT
and directory (i.e. essentially initializing the
directory structure on the disk if the FAT and
directory are written out). /LABEL allows you to
specify a disk label. If /FULL is specified, all
the data blocks on the disk will be cleared. Note
that since /FULL this actually writes the disk,
(data area only) DISMOUNT/NOWRITE won't do you much
good as the files will still be in the directory
but the data will be gone from the disk.
NOTE: /LABEL is NOT currently implemented.
DELETE [/LOG] [/CONFIRM] file_specificaion
This command deletes the specified file or
files from the MSDOS disk.
TYPE [/CONTROL_Z] filename
This command TYPEs (to the screen) the requested
file from the MSDOS disk. Note: it is up to you
to make sure the file is ASCII!
If /CONTROL_Z is specified, the file will be read
until a control-z is encountered, then closed.
SHOW
This command displays the current program status
including whether or not a drive is mounted and the
states of the vmsflx$status and vmsflx$binary flags.
SET [[NO]STATUS|[NO]BINARY|[NO]TEXT|[NO]CONTROL_Z]
This command sets (or resets) two flags in the
program. SET STATUS sets the vmsflx$status flag;
a status message will be displayed for all read,
write, and delete functions (note that /[NO]LOG
overrides the current vmsflx$status flag setting
for a given read, write, or delete). SET BINARY
sets the vmsflx$binary flag and tells the program
that all files whose extentions are not known are
to be assumed binary files for READ and WRITE.
SET TEXT is equivalent to SET NOBINARY. The
CONTROL_Z flag indicates the default detection of
control-z as EOF for READ and TYPE commands.
SCRIPT filename
This tells the program to begin reading commands
from the specified (script) file. Commands are
echoed as they are read. Script files can contain
any legal VMSFLX command including other script
commands. Currently, scripts can be nested up to
10 levels deep. An EXIT command from within a script
file exits the VMSFLX program without completing
processing of any higher script files.
ATTRIBUTE [/LOG] [/CONFIRM] [/[NO]SYSTEM] [/[NO]HIDDEN]
[/[NO]ARCHIVE] [/[NO]READ_ONLY] file_specification
This command allows you to set/reset attributes
for a file or files on an MSDOS disk.
SORT
This command resorts the MSDOS disk directory by
filename. It also sets the modified flag so that
on DISMOUNT or EXIT the directory is updated on the
disk. (Note: I originally had SORT as a settable
option forcing the sort on each WRITE or DELETE. The
problem was it seemed that it was a bit too much
overhead to sort all the time so I settled on a
single SORT command instead. If enough people would
like this the other way, let me know).
HELP
This command displays a brief help screen
describing each command.
^Z or <EXIT> or EXIT
This command exits the program. If a disk is
currently mounted, and implied DISMOUNT is done
(note that if you don't want the directory/fat
updated, make sure you DISMOUNT/NOWRITE first).
Other notes/comments:
=====================
1) There is no support for subdirectories on the MSDOS floppy.
This means that you can only read from or write to files in the
root directory.
2) There is only minimal checking for legal filenames on both the
VMS and MSDOS sides. Long filenames (greater than 8+3 characters)
get truncated before being written, however, there is no check for
legal characters. Also, the program does a simple check for a ']'
character for an input file specification on a write and strips
off any directory portion if the output file specification is
defaulted.
3) The program is written in VAXELN Pascal so you'll need to have
VAXELN on your system if you want to make any changes. As with
most programs, this was kind of a "quick-and-dirty" thing so don't
expect SDC-ready stuff when you look thru the source.
4) Some very interesting things happen if you try to WRITE a text
file in binary mode (which is the default mode if the file
extension is not found in VMSFLX's table). Pascal will only read
one record per block (i.e. one line of your text file) and you'll
get one block per line on the disk (obviously not the desired
results). Until I put the code in to check the VMS file
attributes, make sure you know what you are doing. Note that I've
tried to put all the standard extensions in the table so,
hopefully, all should be well.
5) A known problem: the program does not handle writes of binary
files with fixed length records. Under EPascal, I don't have a
good way of obtaining file characteristics prior to opening the
file. I've found most binary files to have variable length
records and, therefore, I open them up as files of varying_string.
Unfortunately, the open blows away when the file has fixed length
records. I got around this for several files with fixed length
records by editing the file (with TPU) and making a non-
destructive change (such as deleting then undeleting a character)
so TPU would update the output file. The new file has variable
length records and all works fine (I did a read on the new file
and the same one copied onto the floppy by a Rainbow and DIFFed
the two - no differences were found).
I'd be very interested to know what other features people would
like to see in this program. I am definitely planning on the
following:
1) Maintaining file dates across transfers
2) Support for MSDOS directories
Please let me know what else you'd like to see.
I've also been asked to convert the program to VAX Pascal. I will
probably do this eventually; I don't have an up-to-date manual set
for VAX Pascal yet (and besides, I'm much more familiar with
EPascal which has some features I use that aren't available in VAX
Pascal), but I've got one on order.
I've included the revision history from the program to assist you
in knowing what changes have been made. Comments (positive and
negative) are welcome.
Kris DECWET::Barker
================================================================================
{++
{
{ Revision history:
{
{ Version Date Modification
{
{ 0.1 6-June-1986 Original
{
{ 0.2 11-June-1986 Added code to make_name to mask
{ filenames to 7 bit characters
{ Added counters for free directory
{ entries and free clusters and
{ code to display these values on
{ DIR commands
{ Fixed bug in output filename for
{ reads and writes (outfile was
{ not '', but rather, left over
{ from previous call)
{ 13-June-1986 Added DELETE and TYPE commands as
{ well as HELP text to explain them
{ 16-June-1986 Fixed bug in process_disk_write -
{ search was on infile, not outfile
{ (filename on MSDOS disk)
{ Added SYS$SETPRV call to give LOG_IO
{ privilege
{ Added SYS$MOUNT and SYS$DISMOU calls
{ to mount and dismount requested
{ disk
{ Added HELP text listing known file
{ extensions
{
{ 0.3 17-June-1986 Fixed process_disk_write for binary
{ files; it was writing out one
{ too many blocks (all blocks written
{ once EOF is hit)
{ Fixed cosmetic bug in dump_fat that
{ was outputting an extra line with
{ no fat data
{ Added MOUNT command to mount a disk
{ Added DISMOUNT and DISMOUNT/NOWRITE
{ commands to dismount disks (with
{ and without directory/fat updating)
{ Added STATUS command to display current
{ disk status
{ Updated HELP screen for new commands
{ Modified error_message so it ouputs
{ a VMS-looking error string
{ Modified clear_disk to check for
{ (and leave alone) fat entries for
{ bad blocks
{ Added some strategically-placed
{ WRITELNs to improve display
{ 20-June-1986 Added TEST function to run thru a
{ test disk
{
{ 0.4 23-June-1986 Modified process_disk_write - binary
{ files now opened as files of
{ varying_string(32767) rather than
{ assuming all were fixed 512-byte
{ records (which they weren't)
{ Modified process_disk_read to write
{ binary files to VMS as file of
{ varying_string(512) so last record
{ is the correct length
{
{ 0.4A 23-June-1986 Added external declarations of
{ lib$find_file and lib$find_file_end
{ 24-June-1986 Fixed bug in process_disk_write (I had
{ left an if check on text files that
{ caused disk_string to not get
{ initialized for binary files)
{
{ 0.5 24-June-1986 Added SET command and changed STATUS to
{ SHOW (updating HELP accordingly);
{ SET allows setting of default file
{ type and whether or not a message
{ displayed during reads and writes
{ (code also added to process_disk_
{ read/write to handle this).
{ Added crude script processing support;
{ @filename reads commands from file
{ until EOF is seen
{ 25-June-1986 Added check to disallow attempted
{ nesting of script files
{ Added some procedure/function comments
{ Modified directory display to include
{ date and attributes (and modified
{ directory_entry type to support
{ this)
{ Added ATTRIBUTE command which allows
{ setting/resetting of read-only,
{ hidden, system, and archive bits
{ in file attribute
{ Added SORT function to sort directory
{ (note: this was originally a set
{ option, but resorting on each write
{ seemed a bit slow)
{ Added DIR and FAT keywords to DUMP
{ command to dump directory and fat
{ directly from disk (note: may not
{ be updated!)
{ 26-June-1986 Added UPDATE command to write out
{ directory and fat blocks if disk
{ has been modified
{ 0.6 3-July-1986 Modified command input to use
{ CLI$DCL_PARSE/CLI$DISPATCH, etc.
{ in conjunction with a command
{ table
{ 7-July-1986 Added process_script routine (SCRIPT
{ command) to process a script file
{ (needed since @filename doesn't
{ work with DCL_PARSE)
{ Added call to lib$get_foreign to
{ process initial command line
{ Added process_exit (EXIT command) to
{ allow script files to exit program
{ Modified script support for nested
{ scripts
{ Modified sort_directory to skip over
{ label and system files at beginning
{ of disk
{ Added vmsflx$default_block to keep
{ default starting block number; DUMP
{ with no arguments now just dumps
{ the next block
{ 8-July-1986 Misc. fixes to dump_block and
{ sort_directory
{
{ 0.7 9-July-1986 Fixed status message on reads and
{ writes so drive and filename have
{ a ':' between them
{ 10-July-1986 Removed convert calls (replaced with
{ internal routines) to eliminate
{ references to any ELN$ routines
{ (so others can relink without
{ having EPascal RTL)
{
{ 0.8 10-July-1986 Added code to process_disk_write to
{ support wildcarded filespecs
{ on the VMS side
{ Modified sort_directory - label isn't
{ necessarily first, just system
{ files
{ Modified calls to error_message to
{ include filespecs where appropriate
{ Added code to process_disk_read to
{ support wildcarded filespecs
{ on the MSDOS side including a
{ general file-matching routine
{ 11-July-1986 Fixed match_file routine
{ Added support for filename designation
{ on DIR command
{ Added support for wildcard filespec
{ on DELETE command
{ Added status ('deleting file') to
{ DELETE when vmsflx$set_status is
{ true
{ Added wildcard support to ATTRIBUTE
{ command and changed syntax (now
{ command qualifiers are used to
{ set/clear attribute bits)
{ Added /CONFIRM and /LOG qualifiers
{ to READ, WRITE, ATTRIBUTE,
{ and DELETE commands
{ Changed OPEN call for READ command
{ so carriage control is none for
{ binary files
{
{ 0.9 16-July-1986 Added SETtable control_z flag to force
{ reads to terminate on ^Z (also
{ added this qualifier to READ and
{ TYPE commands)
{
{ 0.10 21-July-1986 Modified logic in read_disk_file to
{ accurately terminate file reads
{ (now computes # of bytes in last
{ block and checks)
{--}