CCD - Cedric's CD utility Cedric BEUST 13, bd du Ponant 83700, ST-RAPHAEL FRANCE email: beust@taloa.unice.fr WHAT IS CCD? ------------ ccd is an attempt to have the equivalent to M*-DOS ncd (Norton's cd). This smart utility is most precious for hard disk users: it allows to cd to a directory without having to specify the whole path. For example, if you have a directory dh0:dp/matt/netdcc, just issue the command (0).3:51PM> ccd netdcc and there you are! LEGAL STUFF ----------- Why bother? Nobody ever reads it, anyway... Okay, this program is *not* in public domain. It is freeware, and I hold the copyright on the source, documentation and executable (uh... not so sure this can be done). Clearly, that means that you are free (and welcomed) to give the whole distribution to anyone you want, provided * You don't earn any money doing so * You don't modify any of the files in the distribution without a prior consent from me And now, on to more interesting things. TO MAKE IT WORK... ------------------ ccd is very easy to install. 1) put the ccd command in your c: directory 2) assign CCD: to the directory you would like the config file to go (see below for further explanations about this file); I suggest you choose s: 3) run 'ccd -u dh0: dh1: dh2:' for example, if you often cd into these directories (or subdirectories of theirs). This will create the configuration file 4) et voila! OPTIONS OF CCD -------------- ccd -u e.g ccd -u DH0: DH1: Rebuild the file CCD:.ccdconfig with the recursive list of directories in each volume given ccd -a e.g ccd -a sys List all ambiguities, i.e. all the paths that contain the name you gave. ccd -n e.g ccd -n c: Change to dir name without expanding the pathname. In the example given, the displayed dir will be 'c:'. ccd e.g ccd c: Change to what is closest to the name you gave. The displayed dir would be for example 'DH0:C'. ccd Bring up the graphic representation of your directories. This is a beta version so far, so there is little you can do (mainly, just click on the directory you wish to cd to). HOW DOES IT WORK? ----------------- The current version (2.0 beta) is still very crude. I just wanted to write something that would work quick and dirty. The configuration file is a mere recurrent list of all the subdirectories that exist in the root volumes you specified. When you invoke ccd, it simply parses this file, looking for the fragment of path you gave. If it finds one, it returns the entire line it read in the file. Since the version 1.4, you can specify just a part of the directory. For example, you could ask a 'ccd sys' to change to (...)/system. Of course, there may be ambiguities. Assume I want to cd to a 'lib' directory, but that several of them exist in the list I provided. By default, ccd will cd into the first one, but maybe that's not what you wanted. There are two ways to solve this problem. First, I ask the ambiguities of the name I'm looking for: (0).3:51PM> ccd -a lib dh0:lattice/lib dh1:DP/netdcc/include/lib dh1:DP/gcc/lib dh1:uucp1/lib If I want to cd to dh1:DP/gcc/lib, I just have to type (0).4:01PM> ccd lib 3 Current directory now dh1:DP/gcc/lib I confess it may be a bit cumbersome to use, but nevertheless, it might be shorter than typing the whole path anyway. The second way can also be used to make this task lighter: in case of ambiguities, you will probably notice that you cd to one directory more often than the others. So, since ccd changes to the first one it finds in the config file, you could use this feature and edit the CCD:.ccdconfigfile to put this directory before the other ones. One other problem you might face is that ccd can't find a directory whereas you know it exists. The solution is, of course, that this directory was created after you built the configuration file (the same goes for deletion of directories as well). When this happens, all you have to do is re-run 'ccd -u ' in order to update this file. If your hard disk is very slow and you know it's gonna take some time, you can add the new directory manually in the file as well (on my Quantum HD, updating the file for about 30M of directories takes less than 30 secs...). CAVEAT: The -u name is badly chosen, since ccd actually rebuilds the config file from scratch. I'm thinking about renaming this option -r. CONSIDERATIONS ON THIS PROGRAM ------------------------------ As I told before, this is a very early version and I have many ideas of improvement. Among them: o Modify the Createdir() and DeleteFile() vectors in the dos.library in order to save the user from updating the file themselves. This way, whenever a directory is created/deleted, the configuration file is automatically updated. o Create a more user-friendly interface, maybe even a graphic one, that would display the tree on the screen if no argument is given. The user would then just have to click on the directory they want to change to (done since 2.0 beta). However, I wonder about the interest of such improvements. For example, some users could not appreciate to see dos.library vectors modified, and this could be mistaken with a virus in action... The graphic interface would increase the program size (which is already rather big for such a little command), and so on... That's why I need to hear feedbacks from you! Please, let me know what you think of ccd. You can reach me either by snail-mail or email (preferably by email, it's soooo faster :-)). THANKS ------ --> Matt DILLON, for providing us with such a neat compiler! And for the help along the way... And for uucp. And for dmouse. And for the Cosby Show. And for the electric tooth brush. And for the space shuttle. And for... ouch! [sacked by audience] --> Cedric NEROT, aka Sr, aka Cedric the 2nd, it was an idea of his, and since he's taller and stronger than me, I have to give his name. In retaliation, I hid a virus in his version (snigger, snigger). And he will never read the doc, anyway. --> abcd!Leon, for pointing out to me the 'ccd /' bug that was fixed on from the version 1.4 (sorry, Leon, my mails to you bounced each time I tried, so I don't know more from you...) --- Cedric BEUST --- Nice, May 8th, 1991