home *** CD-ROM | disk | FTP | other *** search
-
- CF VERSION 0.9X
-
- CF TUTORIAL
- ===========
-
-
-
- ASSUMPTIONS
- -----------
-
- This tutorial assumes that:
-
- (a) You have unpacked CF.ZIP and have managed to get CF up and running.
-
- (b) You are running it on an 80x25 colour screen.
-
- (c) You have a method of using CF and reading this text at the same time.
- (You can, of course, print this document and refer to the listing while
- running CF on your computer.)
-
- (d) While running CF, for the purposes of this tutorial, you are using the
- issued CF.INI file, or at least have no exotic parameters configured.
- In particular, I have assumed that a "recognise .cf" line is present in
- your CF.INI file so that you do NOT have to type the .CF extension when
- these files are accessed in the tutorial.
-
- (e) You have unpacked CFTUTOR.ZIP into a temporary directory and have made
- that directory the default directory.
-
-
-
- INTRODUCTION
- ------------
-
- I wrote CF while working on a large piece of software called ProvuII
- (pronounced "proview two") and, hereinafter, refer to this software as P2.
- The need for CF arose because P2 was developed on a number of different
- machines and has well over two hundred modules. Many of th example .CF files
- are connected with this project.
-
-
-
- EXAMPLE ONE
- -----------
-
- The first example illustrates that CF can be used to keep your hard disk
- clean. Type:
-
- CF DRIVE-F
-
- After a period of activity, you will see a typical CF screen. This is a
- complete list of the files that I have on my "F:" drive. Press "?". Apart
- from detailing the available and used memory, it shows you the number of
- files and total bytes of each file "set". (In this case, of course, there is
- only one set - the files from DRIVE-F.)
-
- Note that, in the line that shows how many files are in each "mode", there is
- an item that says "Dup:3". This means that, on my F: drive, there are three
- files that are in more than one place. You can use this fact to "clean up"
- you hard disks. I usually find that I have more than one copy of system
- commands (SORT, MODE, PRINT and so on) in different directories on my "path".
- Using the "Dup files" mode is a good way to find out where they are. Press
- RETURN and then TAB twice. This should take you to a screen that says "Dup
- files" in the top left hand corner.
-
- It shows those three files that I mentioned. Well, let's look in more detail
- at AB.ZIP. From this screen, I can see straight away that I've got TWO
- copies of it - in the bottom right hand corner, just under the "1/3" that
- tells us that the cursor is on the first of three files, is "1/2" which tells
- us that the current copy is the first of two. The text in the bottom left
- hand corner tells us that the latest (in a later section, I'll show that
- "latest" may have NOTHING to do with a file's date and time) copy is in
- F:\ARC\APPS. We can step through the duplicate entries for this file by
- pressing SPACE. Do so, now.
-
- As well as the date and time changing at the bottom of the screen, it now
- tells us that the second copy is in F:\Z. (On my machines, I tend to have a
- few temporary directories on EVERY drive. F:\Z is one of them.) Also, the
- "1/2" has changed to "2/2" since this is the second copy of two.
-
- I keep referring to these two "copies" of AB.ZIP, but it's clear that they
- are NOT true copies - the date, time and sizes all differ. By the way, the
- text in parenthesis after the date and time of copy two ("2/2") shows HOW
- different this copy is relative to the latest. In this case, the second copy
- is 192010 bytes LARGER than the latest copy (if it had been SMALLER, the "+"
- would've been replaced by a "-"), and nearly two days older.
-
- If you keep pressing the SPACE key, you'll end up cycling through all
- duplicate files until you end up at the latest again. In this case, of
- course, you just end up toggling between two files.
-
- In the case of AB.ZIP, we have two files, with the same name, that are
- completely different from each other (although YOU can't tell this just from
- this directory listing). If you now press the DOWN ARROW key, you'll come to
- SIO.C. This file, in F:\MSD\CJPI, is a 'C' source file destined for the JPI
- (TopSpeed) 'C' compiler. Press SPACE and you'll come to the other copy (and
- this time, it really IS a copy) that has been slightly altered to run under
- an old version of the Zortech 'C' compiler.
-
- Ok, that's all for the first example, so let's try something more
- ambitious. Press ESCAPE to get out of CF.
-
-
-
- EXAMPLE TWO
- -----------
-
- This example, introduces the REAL purpose of CF and that is to COMPARE
- directories. Enter
-
- CF RESOURCE P2RES
-
- This time, we have TWO file sets. P2 has it's menu system specified via a
- file built from "source" files that are edited with a program we wrote called
- the "Resource Compiler". The first file set is from a directory called
- D:\RESOURCE and that's where I do development of the latest version of the P2
- menu system. The other file set, this time from an archive called P2RES.ZIP,
- is a backup of D:\RESOURCE. So, how up-to-date is the .ZIP file?
-
- Well, I suppose what I'm interested in here, is the files that are different
- in the two file sets. Press TAB twice and you'll see "Diff files" in the top
- left hand corner. We now see the files that are different for one of two
- reasons; either the date, time or size differ, or one of the file sets does
- not have the file.
-
- In this case, we can see that four BUGS*.DOC files only appear in D:\RESOURCE
- and two P2*.DOC files only appear in P2RES. In fact, what actually happened
- was that I renamed the P2BUGS1.DOC as BUGS-P2A.DOC, P2BUGS2.DOC as BUGS-
- P2B.DOC - BUGS-ALL.DOC and BUGS-P2C.DOC are new files created between the
- time the last backup was done and the time the directory listing was taken.
-
- The other six "different" files really ARE different. Basically, they've
- just been altered as a result of the development work I was doing.
-
- You can always find the files that do NOT appear in at least one file set by
- selecting "Only files". In this case, press TAB again, and you should see
- them.
-
- Because of the attributes used to select files, it is clear that certain
- relationships hold with reference to the NUMBER of files in each group. For
- example, the number of "Same files" plus the number of "Diff files" should
- equal the number of "All files", because different and same are mutually
- exclusive. In the same way, the number of "Only files" plus the "Name files"
- also equal the number of "All files".
-
- Again, press ESCAPE to exit CF. (In future, I'll assume you've the sense to
- do this, without prompting for me, after each example is complete.)
-
-
-
- EXAMPLE THREE
- -------------
-
- Our package, P2, comes on three high-density diskettes. Clearly, when I
- build each release's master disks, I must make sure that I don't miss any
- files out, or give users old copies of files. To this end, after I've
- created each release, I keep a directory listing of the three diskettes I
- issue and, when creating later release diskettes, compare them before handing
- them over to administration. This example demonstrates this process.
-
- The 1V*.CF files represents three issues of P2. Namely, 1.04, 1.05 and
- 1.05a. (The "V" in each file name is meant to represent the decimal point,
- like in the COBOL PICTURE clause.) So, type this
-
- CF -C 1V04* -C 1V05-* -C 1V05A*
-
- Be careful about the "-" in "1V05-*" because, if you miss it out, the second
- file set will include BOTH 1.05 release listings. Also, make sure you
- remember the "-C"s. If you don't, you'll get three file sets with three
- files in each; instead of READING the .CF files, CF will log the DETAILS of
- the .CF files. Not quite the same thing... (You might like to try the
- command WITHOUT the "-C" parameters, first, to see what I mean.)
-
- Have a play with CF at this point, and get a feel for the meanings of the
- different file sets. Earlier in this text, I said I'd mention what the
- "latest" file was and that it did NOT necessarily mean that the file had the
- latest date and time. Looking at the screen before you, this IS true. But
- CF can be run in a mode where it IGNORES certain attributes of a file for the
- purposes of high-lighting files as the "latest". In the default mode, CF
- uses date, time then size, in that order. So if two files have the same date
- and time, CF arbitrarily assumes that the file with the LARGEST size is the
- latest. In general this is true; as development continues, files tend to get
- bigger rather than smaller.
-
- In the default mode, in the three file sets on the screen, the latest files
- will be in the right hand set because this set was created AFTER the other
- two. However, CF can be run in a mode where only the file SIZE dictates
- whether a file is high-lighted or not. To see how this works, type the
- following (if you have a command editor, just exit CF, recall the command
- that started it and append "-IDT" onto the command and run it again):
-
- CF -C 1V04* -C 1V05-* -C 1V05A* -IDT
-
- The "-IDT" makes CF ignore (the "-I" bit) dates and times ("DT"). Press PAGE
- DOWN and look at the entry for MENUFILE.MNU.
-
- This file contains the menus, help text and message text, for P2, in a
- "compiled" format. Note that the "latest" version is the one in the 1.04
- file set. Why? Well, look at the SIZE of the file. Between version 1.04
- and 1.05 of P2, we altered the method of "compilation" to create a more
- compact menu file, so the size of the menu file went DOWN between these
- releases. Mind you, in the NEXT version, we must have added more to the
- file, because the size has gone back up again. Note also that the 1.05
- version is "low-lighted". This means that it is the earliest (in this case,
- SMALLEST) file of the three.
-
- While we are on this page, not that the font down-loader, LOADFONT.EXE, went
- DOWN in size as well - God knows why...
-
- Keep typing TAB until "Only files" comes up. Just one file, POINTS.TSK, is
- shown. That's because I we decided to omit this file from later releases of
- P2.
-
- Type a couple more TABs and you will be at the "Low files" files screen.
- Because there are just three file sets in this example, it should be obvious
- that these are the ONLY three files, out of the 137 files present, that had
- different sizes for EACH of the three releases. Therefore, all of the other
- files must have only changed size at most once.
-
-
-
- EXAMPLE FOUR
- ------------
-
- As I have said before, P2 is comprised of many modules and, as a result, I
- don't have much space on my C: drive. P2 is written in JPI (TopSpeed)
- Modula-2 (so is CF) and, to ensure I'm not wasting space on my hard disk, I
- wanted to check that each .MOD (program source) file had a corresponding .OBJ
- file. How to do this, then? The answer, as if you hadn't guessed, is to use
- CF.
-
- The file MOD.CF contains a directory listing of all of the .MOD files for P2,
- and OVL.CF is a list of all the .OBJ files from the directory where I link
- the .EXE. Now, in this case, I don't want CF to create a line for each file
- NAME, I want it to build a line for each file ROOT (that is, the part of the
- file name EXCLUDING the extension). As before, in the previous example, I
- want to ignore something, so we use the "-I" parameter, but this time
- followed by "E". This will make CF ignore file extensions. Also, I've stuck
- a "-MO" on the end of the command line. This will make CF enter the mode
- "Only files" after it has loaded the file information. This will show me all
- files for which there is a .MOD without a .OBJ, or vice versa. So, do this:
-
- CF MOD OVL -IE -MO
-
- The screen shows some files on the left which has no corresponding entry on
- the right. In the case of ALARMLOZ, this is because ALARMLOZ is a stand-
- alone test program that I haven't had any need for; so, I haven't compiled
- it. And, of course, there are files that appear on the right but not on the
- left. For example, ASCII has no .MOD. The reason is that ASCII is a JPI-
- supplied "library" file and the .OBJ is picked up, by the compiler, from
- another directory.
-
- Before we move on, try this: use TAB to get to "Name files" mode - you'll see
- a warning message. CF usually, when in "Name files" mode, shows a screen
- with each line holding different versions of the same file. However, when
- using the "-IE" parameter, the file names are NOT the same. Only the file
- root is used to distinguish "Name files". In this example, since the files
- on the right are generated, via the JPI Modula-2 compiler, FROM the files on
- the left, the latest files are ALL in the right hand set.
-
- Finally, use the RIGHT ARROW to move the cursor from the left set to the
- right, and note the file name, at the bottom left hand corner of the screen,
- change from AHANDATA.MOD to AHANDATA.OBJ. The REAL file name is ALWAYS shown
- at this position. It is needed, of course, because the entry at the left
- hand end of the AHANDATA line just says "AHANDATA".
-
- In most cases, when using extension ignore mode, the high- and low-lighting
- convey no useful information. This is because you are NOT comparing files of
- the same name - only the same file name ROOT. You can, again using an "-I"
- parameter, make CF ignore dates, times AND file sizes. If you do this, you
- will get NO high-lighting at all. You can try this, if you like. Pop back
- to MS-DOS, and edit the last command you typed to say this:
-
- CF MOD OVL -IEDTS -MN
-
- (Note the "-MN" to get into "Name files" mode.) And, viola!, no high-
- lighting...
-
-
-
- EXAMPLE FIVE
- ------------
-
- For each P2 I generate, I have a .EXE file, fifty (yes, FIFTY) .Onn overlay
- files and a .OLM overlay map. As well as the normal P2, it comes in a "text"
- version (P2 is a hi res graphics SCADA program) called P2T. In this example,
- I have two file sets; each is a directory listing of a complete P2 program.
- One is version 1.05a and the other is 1.05b.
-
- Quite often, I'm interested in the file size differences between the two - if
- the later version has any files are substantially larger than the previous
- version, it could be that I've forgotten something. For example, I may have
- left diagnostic code in, compiled with debug options enabled, or just
- declared some large global variables.
-
- So, let's compare these two programs:
-
- CF P2-1V05A P2-1V05B -IDT -MD
-
- I've added the "-DT" because the files in P2-1V05B will ALL be later than the
- ones in P2-1V05A; '5B is, after all, a later version of the same program.
- The "-MD" is just to get us straight to the "Diff files" mode.
-
- Since we are only high-lighting files ny sizes, you can see straight away
- that some files are smaller in the later version and some larger. In
- general, I've found that the overlays can alter be one or two paragraphs (a
- paragraph is sixteen bytes long)when the code has NOT changed; I assume that
- it's to do with changes in external data structures, or something. Anyway,
- the result is that not ALL the size differences are significant.
-
- The way to find out the large changes is to run the cursor down the NON-high-
- lighted files. That way, you get to see the size (as well as the date and
- time) differences in parenthesis - any small size differences are obvious,
- and you can concentrate on finding out why you have any larger differences
- that you can't account for. If you type a RIGHT ARROW, to place the cursor
- over the right hand file set, you'll see what I mean. While overlays .O01
- and .O02 are significantly different in size, .O03 and .O04 are not.
-
-
-
- EXAMPLE SIX
- -----------
-
- This example show the use of the "Set n files" mode. I have, in this
- example, three file sets. The first is from a floppy disk. The second is a
- listing of the complete P2 development directory. The last is a .ZIP listing
- of my backup archive. The problem is to find out the state of the files on
- the diskette. Are they current files? Are they backed up?
-
- Try this:
-
- CF DRIVE-A P2-SRC P2WORK
-
- This obvious way to see the status of the diskette (set one) files, is to
- just keep paging down in "All files" mode. If you try this with this
- example, you'll find it a tedious process - the other sets just have too many
- files in to make it easy to get to the diskette files. So, instead, press
- BACKTAB (that is, SHIFT + TAB).
-
- This selects ONLY those files that appear in file set one, the diskette
- files. Immediatly, you can see that ALL the files on the diskette are
- current and backed up. Simple, isn't it?
-
-
-
- CONCLUSION
- ----------
-
- I hope you've found this "tutorial" enlightening. I say again, the best way
- to get to know ANY software is to USE it. I think you'll find the more that
- you use CF, the more uses you will find for it.
-
- Mark Davis.
-
-