Tricks For Lsdos And Ldos

MODEL Hill & 4

By Lance Wolstrup

This article was originally planned to cover only LS-DOS 6.3.1 for Model 4. However, since Roy Soltoff of MISOSYS has just released LDOS 5.3.1 for both Model I and III and the command structure is nearly identical to that of LS-DOS 6.3.1, we will include these in our discussion.

Incidentally, the L in LDOS and the LS in LS-DOS stand for LOGICAL SYSTEMS, the company which originally wrote and distributed the DOSes. Now that LOGICAL SYSTEMS is no longer active in the TRS-80 world and ownership for these DOSes has been transferred to Mi-Sosys, wouldn't it be appropriate to change the DOS name to MS-DOS? Well, just thought I'd ask!

Let's get started by looking at a command that most everyone that has ever used a DOS knows, DIR.

DIR < ENTER > will display the visible files on ALL available drives containing a readable disk.

DIR :dn (where dn is the drive number) will display the visible files on the diskette in that particular drive only.

There are two important parameters that can be appended to the DIR command. They are S and I. If added, the S parameter will also display the system files of the chosen drive.

The I parameter will also display the invisible files of the chosen drive.

The S and I parameters can be combined to display each and every file on the disk in the selected drive.

Many people who have switched to MS-DOS have come back to me and bragged that they are now able to use wild-card characters with many of the commands to speed things up. I always tell them that they were able to do that on their TRS-80 machine also, had they only known how.

The wild-card capability is the key to the tricks featured in this installment, so let's proceed to look at just what we can do with it.

There are two types of wild-card characters. The first is the slash (/). It is the filename delimeter, the character that separates the filename from its extension. When used as a wild-card character, the slash means 'ALL'.

For example:

DIR /:0 means 'display ALL the visible files on drive :0.' DIR C/:0 means 'display ALL the visible files on drive :0 starting with C\

DIR C/B:Q means 'display ALL the visible files on drive :0 starting with C that has an extension starting with B'. DIR CH/CM:0 means 'display ALL the visible files on drive :0 starting with CH that has an extension starting with CM'. DIR/SYS:0 (S) means 'display ALL the visible and system files on drive :0 that has the extension /SYS'.

Hopefully the five examples make it obvious that the slash wild-card character allows us to select specific files by using the beginning characters of the filename and/or the beginning characters of the extension. Sometimes we may not know what the beginning character(s) are, so we have the second wild-card character. It is the dollar sign ($)•

The dollar sign wild-card character means 'ANY'. That is, it is a replacement for ANY character at its position in the filename or extension. For example: DIR $$P/:0 means 'display the visible files on drive :0 where P is the third character of the filename'. DIR $E$A/$$D:0 means 'display the visible files on drive :0 where E is second character of the filename, and P is the fourth character of the filename, and D is the third character of the extension.

As you can see, the slash and dollar sign wild-card characters form a powerful means to select a series of files that have certain portions of their filenames and/or extensions in common. This, coupled with the DIR (or CAT command on the Model 4), gives us the ability to perform mass copy and mass delete (just like on the IBM).

How many times have you needed to copy a bunch of files to another disk? Rather than using the COPY command to do this one file at a time, we will use the other file transfer utility supplied on the DOS, the BACKUP utility.

LDOS and LS-DOS provide the finest and most flexible BACKUP utility of any TRS-80 DOS. Not only does it do the normal track-to-track copying as is done on all the rest of the DOSes, it is also capable of doing file-by-file copying. Even better, it is capable of doing file-by-file copying of files selected using wild-cards.

A good example of this is found in the MEMDISK/GRAF-DISKarticle elsewhere in this issue. There we need to copy all the system files from drive :0 to drive :1

First, as I will do before doing anything employing wild-cards, I will take a DlRectory using the same wildcards to be used with the BACKUP utility. Using the example from the MEMDISK/GRAFDISK article, I type: DIR /SYS:0 (S)

Looking over the filenames now displayed on the screen, I make sure that these are indeed the ones I want to transfer to the other disk. I n this case the wild-card mask is correct, so I proceed with the mass file copy. I type: BACKUP/SYS:0:1 (S)

Another example might be if we wanted to copy all the Basic program files that had P as the first character and T as the third character in the filenames from drive :0 to drive :1. First, to take a look at what we would be copying, type: DIR P$T$$$$$/BAS:0

If we are satisfied that these are indeed the files we wish to copy, type:

So, the MS-DOS converts had to grudgingly admit that the TRS-80 is, indeed, capable of mass-copying. "But", they retorted, "we have mass-deletes, you only have the REMOVE or KILL command. You have to delete files one at a time!"

Wrong again. Sure, we can delete files one at a time with the Model 4's REMOVE command (or the Model l/lll's KILL command), butwealso have a built-in DOS utilitythat is more powerful than the MS-DOS DEL command. Our mass-delete powerhouse is called PURGE.

The PURGE command has the same wildcard capabilities as BACKUP. It can be used in many ways, so let's look at each in turn.

To remove ALL the visible files from the disk in drive : 1, type:

PURGE :1

This will display each filename, one at a time, and ask you if wish to remove it. If so, type Y - if not, type N.

This, of course, is mass-delete the hard way. You had to confirm or reject the deletion of each file with a keystroke.

If you are absolutely SURE that you want to get rid of all the visible files, you can make purge skip the confirm/reject prompts by adding the Q = N parameter to the PURGE command (Q = N means NO QUERY). Type: PURGE :1 (Q = N)

Should you wish to remove all the visible and invisible files from the disk in drive : 1, you can use the I parameter (I stands for invisible files); type: PURGE :1 (I)

As above, you will be asked to confirm or reject the deletion of each file. To skip the prompts, type:

Next, to remove ALL files from the disk in drive :1, you have to include the S and I parameters (S stands for system files); type: PURGE :1 (S,l)

Again, it is necessary to confirm or reject each file deletion. To skip the prompts, type: PURGE (S,I,Q = N)

As mentioned above, PURGE has the same wildcard capabilities as BACKUP. If you can find some common denominator in the names of the files you wish to delete, you can get rid of them in one sweep. Keep in mind that it is especially important to first use the DIR command to look at what files the wildcard mask will remove. If you don't, you will most likely end up regretting your actions at one time or another.

For example,- to PURGE all the CMD files on the disk in drive :1, firgt type: DIR /CMD:1

Assuming that the directory display contains the files (and only the files) you wish to delete, type: PURGE/CMD:1

You will be asked to confirm or reject each file deletion, one at a time. However, the best and fastest way to mass-delete these files is to append the Q = N parameter to the command line. This causes the deletions to be performed automatically. Type: PURGE/CMD:1 (Q = N)

The example used in the BACKUP section, where we wanted to copy all the Basic program files that had P as the first character and T as the third character in the filenames from drive :0 to drive :1, can be used to demonstrate the wildcard capability of PURGE.

Assume that we want to remove ALL the files meeting the above specification from the disk in drive :1, we can do it by typing:

To bypass the confirm/reject prompts and thus cause an automatic mass-delete of the specified files, type: PURGE P$T$$$$$/BAS:1 (Q = N)

I cannot emphasize enough that if you are going to use PURGE with wildcards to perform automatic mass-deletes you MUST first use DIR with the same wildcard mask to make sure that you do not cause a bunch of trouble for yourself. PURGE is a powerful command and should be used with caution.

My MS-DOS friends, having seen what our old, 'antiquated' computers can do, are for the moment quiet. I am sure, though, that they will find something in their DOS that will make them try to convince me of the superiority of MS-DOS. Well, we'll see!!

0 0

Post a comment