FILL.DOC 1 Nov 30, 1997 WIN95 AND WINNT NOTICE: As with most DOS-based utilities, this program doesn't understand the weird subdirectories, long filenames, invalid characters that are possible under Windows 95 and Windows/NT. Both operating systems alias long filenames into names like MYFILE~1.TXT and you will need to specify the aliased versions of file names to process them. Under some file structure systems in NT, the program may not work at all. The FILL program is designed to help you move or copy files off a hard disk while reducing the amount of wasted space on the destination disks. Internally, it does this by sorting the file names so the largest files are moved/copied first. It then moves or copies whatever files can fit on the floppy, skipping any that can't. Features: * Can either move or copy the files to the resulting location. * Defaults to moving files if parameters passed in; prompts otherwise. * Can continue to multiple diskettes as desired, beeping if desired when the next disk is expected. * Can move the files in file name order or in any of the other standard ordering sequences. * Can be used to split up files which are too big to fit on a single disk. * Works fine for network transfers where standard MOVE command doesn't always work. * Works fine on Iomega ZIP drives and other DOS-level compatible removable media. * Can create a status/transaction file, showing what was copied/moved. * Can label the output diskette, providing some patterns like disk sequence numbers and dates which it will fill in for you. * Can review and delete if desired any files which are already in the output destination (for example, already on the output diskette). * Can reformat the whole disk if files are going to drive A or B. * Can specify an input file ("@listfile") which contains the files to be copied. * Can specify multiple files to copy/move from the command line. For example: FILL (*.B* *.HTM *.ZIP) A: * The date format shown in reports is based on your country setting. * Pressing escape stops the program early. Limits: * Routine can only process the first 500 files found. It ignores the rest of them. If you're using /MOVE, you can always run it after some of the files are gone and get the rest of them that way. * Routine can only review for deletion the first 200 files in the output location. * Routine does not provide any cool features to fix up destination drives that have surface errors. If it encounters an error, it just beeps, gives you an error message, and returns to DOS. * Routine will not format the output diskette for you. * Switching diskette densities is not recommended (for example, intermixing 720K diskettes with 1.44MB diskettes may cause errors). FILL.DOC 2 Nov 30, 1997 Note on copying/moving files to multiple diskettes: I didn't think this was confusing but a lot of people don't seem to understand the technique of how files are moved to multiple diskettes. Let's say you have six files: A_FILE.ZIP 500K B_FILE.ZIP 300K C_FILE.ZIP 650K D_FILE.ZIP 200K E_FILE.ZIP 450K F_FILE.ZIP 25K You're moving these files to blank 1.2MB diskettes and you have the default /MULTI and /ON settings. The program checks how much space is available on the destination drive and comes back with 1.2MB. It scans the input files and internally sorts them by descending size. It then looks for the biggest file in the file list and comes back with C_FILE.ZIP at 650K. Will this file fit on the destination drive? Yes. It retains that information, figures there is now 550K left on the output drive, and checks for the second biggest file. A_FILE.ZIP is 500K. Will that also fit? Yes. So now there's 50K left. The next biggest file is E_FILE.ZIP at 450K. Will that fit? Nope. Check the next biggest. This continues until it reaches the file F_FILE.ZIP which is only 25K. That's the biggest file that will fit in the remaining 50K. So it has three files to move. What order should it move them? You have /ON set so it's going to move them in file name order. So it moves the following files in the following order: A_FILE.ZIP 500K C_FILE.ZIP 650K F_FILE.ZIP 25K Next diskette. Same process. This time it processes the remaining files: B_FILE.ZIP 300K D_FILE.ZIP 200K E_FILE.ZIP 450K Specifying parameters: Parameters for this program can be set in the following ways. The last setting encountered always wins: - Read from an *.INI file (see BRUCEINI.DOC file), - Through the use of an environmental variable (SET FILL=whatever), or - From the command line (see "Syntax" below) FILL.DOC 3 Nov 30, 1997 Syntax: FILL [ filespec | (filelist) | @listfile ] [ pathspec | /TO pathspec ] [ /MOVE | /COPY ] [ /PROMPT ] [ /Ox | /O-x ] [ /OVERWRITE | /-OVERWRITE | /OVERSKIP | /OVERASK ] [ /Xfilespec ]... [ /ATTR=attribs ] [ /WIPE ] [ /SINGLE ] [ /SPLIT ] [ /FORCE ] [ /-LETTER ] [ /LABEL=label [ /START=n ] ] [ /Frptfile [ /S+ | /S- | S* ] [ /CONT ] [ /TIME ] [ /-BEEP ] [ /Q ] [ /-LAST ] [ /FAKE ] [ /MONO ] [ /Iinitfile | /-I ] [ /-ENV ] [ /? ] where: "filespec" is the file specification for what you want to move. You can specify a drive and path and file wildcards if necessary (for example, "C:\TEMP\*.BAT") but otherwise it defaults to your default drive and directory and takes "*.*". Note that the program cannot handle any request for more than 500 files at a time. "(filelist)" allows you to specify multiple files to be processed from the command line. File names should be separated by spaces. They may include drive, path, and wildcard information. Remember that a command line in DOS cannot exceed 127 characters so you're limited as to how many different file specifications you can provide in this fashion. "@listfile" allows you to have a variety of file specifications saved in a text file named "listfile". You cannot have more than 50 file specifications in this file (and you're still limited to the 500 files total). Each line should consist of a file name with optional drive and path information. Blank lines and lines beginning with semi-colons, colons, or quotes are ignored. "pathspec" (or "/TO pathspec") tells the routine what drive or path to move the files to. The use of the "/TO" keyword is optional unless the specification is being provided in an initfile. The initial default is "A:" (or "/TO A:"). (Use the initfile--see BRUCEINI.DOC--if you need will usually need to change it "/TO B:" or something.) In many cases, the routine doesn't really care whether the source specification precedes or follows the destination specification. If either parameter contains a wildcard or a period, FILL presumes that's the source specification and the other one must be the destination specification. If only one parameter is specified, FILL usually presumes that's the destination specification. Quickie table: User passes Presumed Presumed filespec pathspec FILL C: *.* C: FILL C: A: C:*.* A: FILL *.BAS A: *.BAS A: FILL *.BAS *.BAS A: FILL C: /TO A: C:*.* A: FILL /TO B: *.* B: FILL *.* A: FILL.DOC 4 Nov 30, 1997 "/MOVE" says to move the files instead of copying them. Initially defaults to "/MOVE" if other parameters are passed in (for example, "FILL *.ZIP" will move the files) and prompts otherwise. Check out BRUCEINI.DOC for information on changing the defaults otherwise. "/COPY" says to copy the files instead of moving them. Initially defaults to "/MOVE" if other parameters are passed in (for example, "FILL *.ZIP" will move the files) and prompts otherwise. "/PROMPT" says to prompt for each filename before moving it. Initially defaults to "/-PROMPT". "/-PROMPT" says to not prompt for each file. Initially defaults to "/-PROMPT". "/Ox" and "/O-x" allow you to specify the copy order for the files. "x" can be one of the following: N = file name D = file date and time S = file size If you precede the "x" with a dash ("-"), the sort will be done in reverse order. Note that this parameter does not determine which files are copied; it only determines what order they are actually copied. Since the order that the file tends to show up in a DOS DIR listing is based on creation order, this sequence may be relevant to how the files ultimately show up. Initially defaults to "/ON". "/OVERWRITE" says to overwrite same-named files in the destination path. Initially defaults to "/OVERSKIP". "/-OVERWRITE" says to abort if any same-named files are found in the destination path. Initially defaults to "/OVERSKIP". "/OVERSKIP" says to skip any file that already exists in the destination path. The counts aren't accurate in this case. This is initially the default. "/OVERASK" says to prompt if same-named files exist in the destination directory. Initially defaults to "/OVERSKIP". "/Xfilespec" says to exclude certain filespecs from being moved. You can specify up to 10 exclusion parameters but each must have their own /Xfilespec statement. For example, to move all files except those with a BAS extension, you could say "FILL /X*.BAS". "/ATTR=attribs" allows you to specify a combination of attributes that you want considered. You can specify any combination of R (read-only), H (hidden), S (system), or A (archive bit). Precede any character(s) with "-" to exclude instead of include. Unlike with the DOS DIR command, the inclusions and exclusions are subject to "OR" conditions; /ATTR=HS will retrieve any file that is either hidden or a system file or both. You can specify "/ATTR=ALL" to specify that all files are to be processed. Initially defaults to /ATTR=-H-S (skip hidden or system files). FILL.DOC 5 Nov 30, 1997 "/WIPE" says that if the destination drive has files on it, prompt the user for whether these files should be deleted or not. Six sub-options show up in this case: Do *NOT* delete the x file(s) Don't delete anything List file(s) List the files but don't delete any of them. The user will be reprompted for these four options after pressing a key. Select file(s) to delete List the files and allow the user to select any to be deleted. Keys: * Cursor keys -- move among list * Space -- select that file * Ctrl-Enter -- select all files * Ctrl-bs -- deselect all files * Enter -- process those tagged * Esc -- skip processing After pressing Enter, the selected files will be deleted. You will then get the standard four prompts again. Delete all file(s) Delete all files in the specified directory. Subdirectory files will not be deleted. Reformat the diskette If your output drive is either A or B, the program will shell to DOS and execute a "FORMAT d:" command. This (and the next) sub-option will result in the subdirectories being eliminated, something which the prior sub-options don't do for you. Quick-reformat the diskette If your output drive is either A or B and you're running under DOS 5.0 or higher, the program will shell to DOS and execute a "FORMAT d: /Q" command. Initially defaults to "/-WIPE". "/-WIPE" reverses /WIPE. Initially defaults to "/-WIPE". "/SINGLE" says process only one diskette at a time and to not prompt for the next diskette once the first gets filled up. Initially defaults to "/MULTI". "/MULTI" says to go to a second disk if all of the files can't fit on the first diskette. Initially defaults to "/MULTI". FILL.DOC 6 Nov 30, 1997 "/SPLIT" says to split up large files which otherwise would not be able to fit onto the output disk. For example, /SPLIT is useful when you have a 1.8MB file that you're trying to copy or move to a 1.2MB or 1.44MB diskette. Unless /FORCE is specified, files are split only if an empty output diskette would not be able to support the file; FILL will not typically split up a 800KB file just because the 1.2MB output diskette only has 600KB free. /SPLIT must be used with a specific file request; not a wildcarded one. Split files are given the file extensions of .x01, .x02, etc (see /LETTER vs /-LETTER options below for explanation of the "x") until all necessary splitting is accomplished. To put them back together again, use the DOS COPY copy with the /B option. For example: COPY TEST.Z01/B+TEST.Z02/B TEST.ZIP If (and ONLY if) you use something like Norton's DIRSORT command so the files appear in sequence in your directory (and not because of any DIR /ON specification!), you can also concatenate using wildcards: COPY TEST.Z0*/B TEST.ZIP [ONLY IF PHYSICALLY IN CORRECT ORDER] Do NOT try this unless you're sure though, okay? Note that if you have a SET DIRCMD setting, the directory may look ordered when it's not. Use DIR /-O to check if necessary. "/-SPLIT" reverses "/SPLIT" and is initially the default. "/FORCE" says to split up files when /SPLIT is used even if the file is smaller than the output disk would be. So, if you have a 1.44MB diskette and a 600K file, /FORCE will allow it to be split. This is not the default because you typically do not want to split up every file; just the ones that are too big. "/-FORCE" only allows files bigger than the output destination to be split up. This is initially the default. "/LETTER" says that when /SPLIT is specified, use the first letter of the original file extension when naming the split up file. For example, TEMP.ZIP would become TEMP.Z01, TEMP.Z02, etc. This does not affect files which do not get split. Initially defaults to "/LETTER". "/-LETTER" says that split up file names should be numeric only. TEMP.ZIP becomes TEMP.001, TEMP.002, etc. This does not affect files which do not get split. Initially defaults to "/LETTER". "/LABEL=label" specifies the volume label to be written to the output disk. By default, the label is not changed. The label can be a quoted mixed-case string. It can contain several replaceable lowercase only parameters: "mm" is replaced with the two-digit month, "dd" is replaced with the two-digit day, "yy" is replaced with the two-digit year, and "n" or "nn" or "nnn" is replaced by the sequence number of the disk. All numeric fields are padded to the left with zeroes as necessary. If the current date is January 20, 1996: /LABEL="BKyymmdd nn" will label the first first "BK960120 01", the second disk "BK960120 02" etc. Note that labels can be no longer than 11 characters in length. All characters except the replaceable parameters will be translated to uppercase characters. FILL.DOC 7 Nov 30, 1997 "/START=n" specifies the first sequence number to use in place of "n", "nn", or "nnn" in the /LABEL parameter. Defaults to "/START=1". "/Frptfile" specifies the name of a status report file to be created. This file is a text file that reports on what's been processed by the program. If it exists already, the file is appended to, not overwritten. A sample of some lines from the file using the /S* option (which is not the default): FILL results for /copy *.exe /ftest.txt /beep /wipe /s* /split Being run on 01-20-1996 at 17:58:10 Label FileName Date Time Size Operation TEST93 #01 AV.EXE 09/29/95 00:50:58 70,282 SKIP TEST93 #01 BC.EXE 08/19/94 23:59:00 150,562 SKIP TEST93 #01 BFIND.EXE 08/02/95 23:07:08 60,016 SKIP TEST93 #01 VBDOS.EXE 08/19/94 23:59:00 555,520 COPY BRUCE AV.EXE 09/29/93 00:50:58 70,282 SKIP BRUCE BC.EXE 08/19/92 23:59:00 150,562 SKIP BRUCE BFIND.EXE 08/02/93 23:07:08 60,016 SKIP "/S+" specifies that the only files to be written to the status file are those files that actually get copied/moved. This is the default. "/S-" specifies that the only files to be written to the status file are those files that did not get copied/moved. Since the skipping is determination is done with each disk, the status file may show the same file name as "SKIP" over and over again. "/S*" specifies that the status report should contain all files copied/moved as well as skipped. This can be a huge report. "/CONT" is used if you want the routine to continually check your floppy drive to see when a new diskette has been put in and continue once it recognizes this has happened. The only time you'd have to press a key is if you want to stop processing diskettes (in which case you'd press Escape). The determination of a new diskette is made by seeing if the number of clusters on the current diskette matches the number remaining on the old one. "/-CONT" reverses "/CONT" and is initially the default. "/TIME" says to show how much time it took for the transfers, showing you a bytes copied/moved per second. "/-TIME" says to skip the bytes per second information. This is initially the default. FILL.DOC 8 Nov 30, 1997 "/BEEP" says to beep once the routine is done doing its thing (a high tone followed by a low one). It will also beep whenever it's time to stick in a new diskette (a low tone followed by a high one). Initially defaults to "/BEEP". "/-BEEP" says to not beep upon completion. Initially defaults to "/BEEP". "/Q" turns off the file-by-file status reporting. "/LAST" says to indicate when you are starting the last disk in a multi-disk set. This doesn't apply to /SPLIT cases. Some people consider the indicator to be rather unappealing on the screen so it's optional. This is initially the default. "/-LAST" turns off the last-disk indicator in a multi-disk set. "/FAKE" turns off the actual copying of files. It basically puts you into simulation mode so you can see what it would do, how many disks it would take, et cetera. "/-FAKE" reverses "/FAKE" and is initially the default. "/MONO" (or "/-COLOR") does not try to override screen colors. Initially defaults to "/COLOR". "/COLOR" (or "/-MONO") allows screen colors to be overridden. This is initially the default. "/Iinitfile" says to read an initialization file with the file name "initfile". The file specification *must* contain a period. Initfiles are described in the BRUCEINI.DOC file. Initially defaults to "/IFILL.INI". "/-I" (or "/INULL") says to skip loading the initialization file. "/ENV" says to look for %var% occurrences in the command line and try to resolve any apparent environmental variable references. See BRUCEINI.DOC for more information. This is initially the default. "/-ENV" says to skip resolving apparent %var% occurrences in the command line. Initially defaults to "/ENV". "/?" or "/HELP" or "HELP" shows you the syntax for the command. Return codes: FILL returns the following ERRORLEVEL codes: 0 = no problems, all files copied 1 = no problems, but some files skipped since /-MULTI 251 = couldn't find @listfile file 252 = had DOS errors copying/moving the files (bad sectors found) 253 = had problems copying/moving the files 254 = no files found to copy/move 255 = syntax problems, or /? requested FILL.DOC 9 Nov 30, 1997 Author: This program was written by Bruce Guthrie of Wayne Software. It is free for use and redistribution provided relevant documentation is kept with the program, no changes are made to the program or documentation, and it is not bundled with commercial programs or charged for separately. People who need to bundle it in for-sale packages must pay a $50 registration fee to "Bruce Guthrie" at the following address. Additional information about this and other Wayne Software programs can be found in the file BRUCE.DOC which should be included in the original ZIP file. The recent change history for this and the other programs is provided in the HISTORY.ymm file which should be in the same ZIP file where "y" is replaced by the last digit of the year and "mm" is the two digit month of the release; HISTORY.611 came out in November 1996. This same naming convention is used in naming the ZIP file (FILLymm.ZIP) that this program was included in. Comments and suggestions can also be sent to: Bruce Guthrie Wayne Software 113 Sheffield St. Silver Spring, MD 20910 e-mail: WayneSof@erols.com fax: (301) 588-8986 http://www.geocities.com/SiliconValley/Lakes/2414 Please provide an Internet e-mail address on all correspondence.