Copying Directory Contents ( eg. from Fred Fish Disks) H.A.Trethowen, Wn ------------------------------------------------------ March 1988 The command file "DirCopy" is designed to help one-drive users with copying grouped files. It is written to run with a RAM:Disk, to give adequate speed. Whilst you can do the job with some variation of "Copy All", you might be in for an evening of disk-swaps( it took me over 70 disk swaps to transfer 14 ONE-WORD files this way). But COPY ALL does preserve the directory substructure. It's OK with small files. Even then it is messy opening temporary files, transferring them, and then cleaning up. Two alternative command files to handle this are given below: DIRCOPY uses separate copying of each subdirectory DIRQOPY which is a 'quick' version for smaller jobs, and handles all subdirectories automatically USAGE: ------ (a) DIRQOPY You set up a RAM:disk, and then call:- X DirQopy Dirname (b) DIRCOPY You set up a RAM:disk, and then call:- X Dircopy Dirname [subdir1] [subdir2] [subdir3] You then get prompted to insert the 'from' disk. When you signal that you are ready, the system then lists the files as they are copied to RAM:. It then asks you to insert the 'to' disk, and when you signal you are ready, the directories are created on the 'to' disk and the files are again listed as they are copied to it. Finally the RAM: copies are deleted and the space released. DIRQOPY, provided there is enough RAM space, will handle all the subdirectories with no fuss at all. With DIRCOPY you can break the job into smaller pieces if RAM isn't big enough. You have to copy the subdirectories sequentially. First you copy the main directory contents, and then work your way down through the subdirectories. You have to follow the hierarchic structure of the directory (you can't create a subdirectory below a not-yet-existing name). As indicated, DirCopy provides for up to 4 levels of subdirectory, but this can be easily extended if you need. EXAMPLE: -------- A good example is the "Shanghai" example on FF 55. This has the directory structure below:- Shanghai s startup-sequence fonts garnet 16 9 gene 8 garnet.font gene.font winter .info Disk.info Installation Shanghai Shanghai.info This has 3 levels of subdirectory and to copy it in full, preserving all the structure, can be done either as: (a) X DIRQOPY ShangHai but you must have enough free RAM (over 190k in this case), (b) DIRCOPY Shanghai This requires the following calls, IN THIS ORDER :- x dircopy Shanghai x dircopy Shanghai s x dircopy Shanghai fonts x dircopy Shanghai fonts garnet x dircopy Shanghai fonts gene x dircopy Shanghai winter The result of this is to produce an exact copy on your 'to' disk, of the full structure of Shanghai. You don't have to open any directories. RAM: is cleared each pass. Application ----------- My usage of Dir?opy is principally to compact up the things I want out of Fred Fish Disks, on to my own collection disks. I think that what is really desired is to have a system that will find out what subdirectories there are, and do all the above automatically. But Dir?opy will have to do for now. The main residual deficiency of Dir?opy, is that it does not handle gracefully the problem of "RAM: full" or "Disk full" events whilst copying. Using Workbench 1.1 helps with the former, as it leaves more free RAM space. Suggestions welcome.