HP 3000 Manuals

Converting and Copying Files [ HP Resource Sharing for MPE/iX ] MPE/iX 5.0 Documentation


HP Resource Sharing for MPE/iX

Converting and Copying Files 

DISCMGR provides a command for converting files from DOS to MPE and vice
versa.  These commands (DOSTOMPE and MPETODOS) are especially useful if
you use both HP 3000 and PC programs, and want to move data from one to
the other.

There is also a COPY command to copy files from one shared disc or
directory to another.

These commands in their basic syntax are quite easy to use, and the use
of wildcards and command options can make them very powerful.

First, let's look at the basics.

To convert file(s) from DOS to MPE: 

   1.  Start DISCMGR.

   2.  Connect to the shared disc that contains the file(s) you want to
       convert.

   3.  Enter the following command:

            DOSTOMPE dosfilename TO mpefilename 

       The conversion begins without further prompting.  When it is
       complete, the following message appears, where n is the number of
       files converted or copied:

       n file(s) converted.

       For example, to convert the shared disc DOS file TEST1 to an MPE
       file with the name MPETEST1, enter:

            DOSTOMPE TEST1 TO MPETEST1

To convert file(s) from MPE to DOS: 

   1.  Start DISCMGR.

   2.  Connect to the shared disc to which you want to convert the MPE
       file.

   3.  Enter the following command:

            MPETODOS mpefilename TO dosfilename 

       The conversion begins without further prompting.  When it is
       complete, the following message appears, where n is the number of
       files converted or copied:

       n file(s) converted.

       For example, to convert the MPE file called JUNRPT to a DOS shared
       disc file with the same name, enter:

            MPETODOS JUNRPT TO JUNRPT

To copy a file from one shared disc or directory to 
another: 

   1.  Start DISCMGR.

   2.  Make sure uses are established for the shared disc(s) you want to
       use.

   3.  Enter the following command:

            COPY [drive:] dosfilename TO [path]newdosfilename 

       For example, to copy the file SALES from S: to the subdirectory
       ACCTNG on the X: drive, you would enter this command:

            COPY S: SALES TO X:\ACCTNG

       Since a new filename is not included, DISCMGR creates the new
       filename with the same name as the old filename.

Using Wildcards 

Now that you know the basic commands, let's take a look at how MPE and
DOS wildcards let you select multiple files for copy or conversion.

You can use MPE wildcards in the source filename in the MPETODOS command
and in the target filename in the DOSTOMPE command.

          MPE Wildcards 

   Symbol                                     Useage 

--------------------------------------------------------------------------------------

@            Specifies one or more alphanumeric characters in an MPE filename.
             Similar to the * wildcard in DOS, except that you can enter other
             characters after the @ symbol when specifying the MPE source file.  For
             example, if you enter A@S, all files that begin with A and end with S
             will be selected, for example, AS, ABS, ALPHAS.

#            Specifies one numeric character in an MPE filename.  No DOS equivalent.

?            Specifies one alphanumeric character.  Identical to ?  in DOS.

You can use DOS wildcards in the target filename in the MPETODOS command,
in the source filename in the DOSTOMPE command, and in the source and
target filenames in the COPY command.

          DOS Wildcards 

   Symbol                                     Useage 

--------------------------------------------------------------------------------------

?            Specifies a single valid character in a DOS filename.

*            Specifies one or more alphanumeric characters in a DOS filename.  For
             example, the filenames *.* and * equate to all files.  The filename *.
             means all files without extensions.  Any characters entered after the *
             symbol will be ignored.  For example, if you enter A*S, the S will be
             ignored and all files that begin with A will be selected.

DOS filenames can contain characters that are invalid in MPE filenames.
For example, MPE filenames cannot contain extensions or certain special
characters such as $ or _.  DISCMGR produces valid MPE filenames by:

   *   Dropping DOS file extensions 

       For example, the DOS filenames REPORT.M1 and MYFILE.EXT would be
       changed in MPE to REPORT and MYFILE. Make sure your files have
       different filenames before you use this command or all files will
       not be converted.  If you tried to convert the files MYFILE.ABC
       and MYFILE.DEF by using the wildcards M*.*, only the last file
       would be available in MPE. (Both files would be converted, but the
       last one converted would write over the first file.)

   *   Eliminating invalid MPE characters 

       For example, the DOS file SAMPLE$1 would be changed in MPE to
       SAMPLE1.

   *   Providing generic filenames when DOS filenames are composed 
       entirely of invalid MPE filename characters 

       In an interactive session, DISCMGR prompts you for a unique
       filename when a valid MPE filename cannot be produced.

       In batch mode, DISCMGR creates generic filenames in the format
       FILEnnnn, where nnnn is a number from 0001-9999.  For example, the
       DOS filename 123&&##%.EXT would be renamed in MPE to FILE0001.

   *   Not converting a file when a duplicate filename exists 

       In an interactive session, DISCMGR prompts you for a filename when
       it encounters a duplicate filename (and you haven't specified the
       REPLACE option).

       In batch mode, DISCMGR does not convert duplicate files unless you
       specify the REPLACE option.

Examples 

Let's say you want to convert the following MPE files to DOS files ending
in the extention .GAL:

READ01R
READ02R
READ03R

You could enter the following command:

     MPETODOS R@##R TO *.GAL

The resulting DOS files would be:

READ01R.GAL
READ02R.GAL
READ03R.GAL

You use the ?  wildcard in a similar fashion.  Let's say you want to
convert the following DOS files to MPE files that begin with Z and the
fifth letter of the filename is Z:

MYTEXT
MYREPT1
MYTEXT2

Enter the following command:

     DOSTOMPE M* TO Z???Z@

The resulting MPE files would be:

ZYTEZT
ZYREZT1
ZYTEZT2

Options 

Several options are provided with the copy and conversion commands to
give you further control over the conversion, such as listing files as
they are converted, or defining the record size.  Three of these options
(SHOW, MOVE, and REPLACE) can be used with all three copy and conversion
commands.  More than one option can be used in a single command, except
that you cannot use both ASCII and BINARY in the same command.

SHOW                  To see the filenames as they are converted, use the
                      SHOW option:

                           DOSTOMPE [drive:] dosfile TO mpefile;SHOW

                      For example, let's say you want to convert all DOS
                      files beginning with RE to MPE, and you want to see
                      the files as they are converted.  You would enter:

                           DOSTOMPE RE*.* TO @;SHOW

                      The resulting display might be:

                           READ1 --- READ1
                           REFILE1 --- REFILE1
                           REFILE2 --- REFILE2
                           RENOTES.TXT --- RENOTES

MOVE                  To actually move a file from MPE to a shared disc,
                      use the MOVE option.  When you specify MOVE, the
                      source file is purged after the conversion.  For
                      example, the following command moves the MPE file
                      TEST to a shared disc, removing the MPE file
                      entirely:

                           MPETODOS TEST TO *;MOVE

REPLACE               To write over existing files with the same name,
                      use the REPLACE option.  For example, to copy the
                      files DOSFILE1.EXT through DOSFILE9.EXT on the J:
                      shared disc to the M: shared disc, replacing any
                      existing files with the same names, enter this
                      command:

                           COPY J:DOSFILE*.* TO M:*.*;REPLACE

                      If you do not specify the REPLACE option and a file
                      with the same name already exists, DISCMGR asks if
                      you want to replace it.  If you enter Y, DISCMGR
                      replaces the existing file.  If you type N, DISCMGR
                      prompts for a new filename.

Command-Specific Options 

BINARY                The DOSTOMPE command lets you specify binary DOS
                      files, such as a file created with HP Drawing
                      Gallery or Charting Gallery.  For example, to
                      convert the Gallery file called PICTURE.GAL to MPE,
                      enter this command:

                           DOSTOMPE PICTURE.GAL TO @;BINARY

ASCII                 The DOSTOMPE command lets you specify ASCII DOS
                      files.  For example, to convert the DOS file
                      TEXT1.EXT to MPE in an ASCII format, enter this
                      command:

                           DOSTOMPE TEXT1.EXT TO @;ASCII

                      ASCII is the default value, so if you do not
                      specify a file enter, ASCII files will be created.

RECSIZE               The DOSTOMPE command lets you specify the record
                      size with a negative number for bytes or a positive
                      number for words of the target file.  If you
                      specify the BINARY option, the default value is
                      -256.  If you do not specify the BINARY option, the
                      default value is -80.  For example, to specify a
                      record size of 120 bytes, enter this command:

                           DOSTOMPE TEXT1.EXT TO @;RECSIZE=-120

TREE                  The COPY command lets you specify TREE, which lets
                      you create a DOS tree structure on the target
                      shared disc.  Let's say you want to copy the files
                      on the J: shared disc in the subdirectory ADMIN to
                      the N: shared disc.  In order to maintain the DOS
                      tree structure, you could enter:

                           COPY J:\ADMIN TO N:\subdir1*.*;TREE

Temporary Connections 

There are two more ways you can use the copy and conversion commands.  If
you haven't established a connection to the shared disc you want to use,
you can access the shared disc temporarily by designating the MPE group
and account or the sharename in the command.  This temporary connection
lasts only as long as the command needs to execute.

For example, to convert a file in a shared disc called FILE.TXT to an MPE
file called FILE1 when you are not connected to that shared disc, you
could enter:

     DOSTOMPE MPE: \account\group\FILE.TXT TO FILE1

This connects to the shared disc temporarily by identifying the account
and group containing the shared disc.

You could also enter:

     DOSTOMPE !sharename [password]:FILE.TXT TO FILE1

This connects to the shared disc temporarily by identifying the shared
disc sharename.


NOTE Your ability to use the \account\group method to connect to a shared disc depends on your HP 3000 capabilities. If you have System Manager (SM) capability, you can connect to any account and group. If you have Account Manager (AM) capability, you can connect to any group in your account. If you have basic capabilities, you can connect to the logon account and group.


MPE/iX 5.0 Documentation