< Previous  |  Contents  |  Next >

14 : PIP – The File Copier        


PIP is the Peripheral Interchange Program and is used to transfer or copy files from one device to another. You can copy a complete disc onto another one, perhaps to make a backup copy, or more sedately transfer a file from one disc to another. In addition PIP can also combine several files to form a new file, and is also capable of modifying the file or files as it copies. PIP is a transient command; its syntax is:

PIP <command line>

In both instances PIP is loaded. The former method will result in an asterisk being displayed – this is the PIP prompt at which PIP commands can be entered and executed. To return to the 'warmth' of DOS Plus press CTRL-C. The PIP command mode is useful if you anticipate performing a great deal of information swapping and to-ing and fro-ing, but for most applications the simple command line approach is best.

The basic format of the PIP command line is:

PIP d:<afn>=d:<afn>

As with most DOS Plus commands the destination details are stated first, to the left of the equals sign, followed by the source details to the right. For example, if we wished to copy the PIP command itself from a disc in drive A to a disc in drive B we would use:


In the course of this command we could rename the file, by specifying a new name in the destination half of the command. To transfer a file called TEST.HEX on drive A to drive B, but changing its name to TESTBAK.HEX we would use:


An important point to remember when using PIP is that the source file is not affected in any way by the transient command, it merely makes or takes a copy of the original.

Using PIP

PIP can be used to make a complete copy of a disc in one drive to an empty disc in a new drive. To copy all the files on the disc in drive A to the new disc in drive B, you can type:

PIP B:=A:*.*

the screen will then display:


with the name of each file following as it is copied from drive A to drive B.

By specifying a parameter in brackets at the end of the command line, it is possible to have PIP verify the data it has transferred against the original (data does not normally become corrupted at this point, especially if quality discs are being used – but for peace of mind it may be worth using). The parameter is V for verification, and would be used thus:

PIP B:=A:*.*[V]

Note that the parameter is typed hard against the command, ie with no spaces in between. Now each file transferred will be checked against the original to ensure validity. If an error is detected an error message is displayed. In this instance you can try re-copying this file – if this fails then it is likely that your disc has become damaged and a newly formatted one should be sought and the transfer sequence performed again. Discard the problematic disc.

Groups of files can be copied by using suitable wildcard combinations. The command:


will copy all of the command files present on the disc in drive A to the disc in drive B. Note that if COM files of identical names exist then they will be destroyed, but not the source files. In the past examples we have always used drive A as the source and drive B as the destination – this is not meant to be misleading, as it is quite possible to copy from a source disc in drive B to a suitable destination disc in drive A, simply by arranging the command line in the correct sequence. To copy all the COM files on drive B to drive A use:


File Concatenation

As mentioned at the start of this chapter, PIP can also be used to join several source files into a single destination file, a process known as concatenation. The format of this command is:

PIP destination=source1,source2, etc

The source files are referenced by name, separated from each other by commas and there must be no ambiguity. The resultant file will be titled as defined by destination. If drive A contained the ASCII files FILE1 and FILE2 they could be concatenated onto a single file called TEXT, on drive B as follows:


When files are concatenated in this manner they are joined together in the order specified by the command line. In the example above FILE2 will be added onto the end of FILE1. By reversing the filename order FILE1 can be made to combine onto the end of FILE2:


Command Mode

Just typing 'PIP' at the keyboard will invoke the command mode. This is signified by the PIP prompt of an asterisk being displayed on the screen thus:


The asterisk can be thought of as being a shorthand for PIP itself, you now need to type just the command line itself without entering the PIP command. Once you enter a command it is executed, but instead of returning to the DOS Plus prompt on completion, you are returned to the PIP prompt where further PIP commands can be entered.

To leave PIP and return to DOS Plus simply press RETURN or CTRL-C. The following dialogue between man and machine shows how some of the commands we have used already would be entered at PIP command Mode level:



PIP Parameters

The PIP parameters concept was introduced earlier when one of them, V, was used to verify a file had been copied correctly from one disc to another. There are a number of parameters and they may be used in combinations – provided they make sense. And they must, of course, be totally enclosed within [ ] at the end of the command line to make sense.

One useful parameter is E, which stands for 'echo'. It is quite often useful to include this with other parameters so that everything that the PIP command is doing will be shown on the screen. This does tend to slow down the operation of PIP, but if speed is of the essence then the echo parameter can be omitted.

To illustrate how parameters may be combined, we can look at an imaginary example. There are two parameters that allow text files to be translated from upper case to lower case characters and vice versa. The parameter letters are L and U respectively. Suppose we wish to copy a text file on a disc in drive A, called FHELP.ASC to a disc in drive B, converting all characters to lower case and displaying the operation on the screen. We would use:


In the above example the parameters have been entered with no spaces between them, however they may be included for readability if so required. Although combinations are generally allowed, some parameters can only be used with certain types of file, as in the above example. It would be pointless using character translation on anything but an ASCII file. The various PIP parameters are outlined briefly below.

Dn – Delete Characters

This parameter expects a numeric value, n. It will delete any characters after the nth column. For example, Dn can be used to truncate long lines that are being sent to a narrow printer or VDU, or you might only need to see the first nth columns of a file.

E – Echo to Screen

This parameter enables you to see the 'write' operation to the specified destination. Example:


F – Remove Formfeeds

The F parameter is used to remove, or filter, formfeeds from a file. A formfeed is a page eject type character, with ASCII code 12. It is quite often used with the P parameter as detailed below.

H – Hexadecimal Data

This is used to transfer hex data, and PIP checks to ensure that only valid hexadecimal characters are contained within the file. Any non-hex characters encountered during the transfer are reported, and you are prompted for corrective action:


I – Ignore Any :00 Characters

This parameters invokes the H parameter in its action but will also ignore any :00 records in the file transfer.

L – Force to Lower Case

Forces any upper case characters in the source file to lower case, before transferring them to the destination file. Only valid for use of files of ASCII text. Example:


N – Number All Lines

This adds line numbers to the file being output, the number being followed by a colon. Example:


A typical output might be:

1: This is line number one
2: This is line number two
3: This is line number three
4: ...and so on...

N2 – Number All Lines With Zeros and Tabs

This adds line numbers to each line but includes leading zero's with a tab being added after each line number. If the destination of the file is disc then tab is set to eight, otherwise the printing device set tab is used. Example:


The typical output might be:

000001:   This is line number one
000002:   This is line number two
000003:   This is line number three
000004:   ...and so on...

O – Object Files

This is used when non-ASCII files are to be transferred from one device to another. It specifies that the end of file marker used by DOS Plus, a CTRL-Z, is to be ignored when concatenating files.

P – Page

This parameter is used to force a formfeed after every 60 lines of text.

Pn – Page Length

This sets the length of a page to n lines after which a formfeed will be generated. Used with the F parameter it can be used to issue a formfeed at a desired point in a file. Example:


will issue a formfeed after every 45 lines. Any other formfeeds are filtered out.

Q – Quit File Copying

This strange looking parameter is used when you do not wish to copy an entire file in a PIP operation. Used in conjunction with the parameter Ss^Z parameter (see below) it can be used to inform PIP where to start (S) and quit (s) copying the file. If you use Q but not S then the copy will start at the beginning of the file and quit where you specify. The starting or quitting location is specified as a string of characters. In an imaginary file we might wish to copy the file up until the word TESTING, which might be a subheading or a keyword placed there by you, in the file BRIEF.TXT This can be performed using:


Remember the ^Z character is in fact, CTRL-Z and must be inserted into the parameter by pressing the CTRL and Z keys together. Note also that the parameter string used in this way is case independent and all letters will be translated to uppercase. If you wish to search for a lower case character string you must do so by first entering the PIP command mode by typing PIP. Now entering the same command will allow lower case character strings to be sought. The above command will copy the file called BRIEF.TXT from drive A to drive B until it encounters the word TESTING. This word is not transferred to the new file.

S<string>^Z -Start File Copying

This parameter allows you to copy part of a file starting at the specified string up until the last character in the file. To copy a file called BRIEF.TXT in drive A to drive B from the word TESTING use:


The notes on CTRL-Z and character case, detailed above, also apply here. Enter PIP command mode to search for lower case character strings. Used in conjunction with the Q<string>^Z parameter, a section from within a file can be copied to another file:



In the above example, a copy of a portion of a file called BRIEF.TXT is made from drive A to drive B, renaming the filename extension, SEC for section. The starting point of the section to copy is the word 'Today' while the quitting point is at the keyword TESTING. Because 'Today' uses lower case characters PIP command mode has been used to perform the transfer.

Tn – Tab to n

This parameter allows you to set the tab width, to the nth column.

U – Force to Upper Case

Forces any lower case characters in the source file to upper case, before transferring them to the destination file. Only valid for use of files of ASCII text. Example:


V – Verify

All data copied is compared to the source to ensure against corruption. The comparison is performed after reading and writing the data byte, and comparing the byte read with that in the output buffer.

W – Write

This parameter allows write protected files to be over written without being prompted about the validity of such a request. Normally if you try to overwrite an existing file that is write protected, you will be asked if you wish to overwrite it. This option in effects turns this safety net off. Use with care!

< Previous  |  Contents  |  Next >

About the Master 512 | Bibliography