snames 1.03 (c) David M. Balean 2004, Sunday 7th November 2004 GUI version Fitness for actual use not guaranteed! However, I think it works OK. It is capable of deleting files, so make sure you know what you're doing! Description =========== Search a drive/directory or drives/directories for all files with the same name. Send a list of their full pathnames to a file in the designated output drive/directory. This output file is called "samenamesXXX.txt" where XXX is a number. If that file already exists the numeric part of the output filename is incremented until satisfactory. This avoids over-writing any pre-existing file. If no drive/directory is chosen the output goes to the root of the first drive/directory that is being scanned if the user continues the scan. If the user chooses to delete the extra files the user is given the chance to select that they are saved to a sinkhole. The sinkhole is placed in the same drive/directory as samenamesXXX.txt and it is called samenamesXXX.sinkhole, but the XXX part may be different if aleady exists. Alternatively the user may choose to move all the files with the same name to the sinkhole for later perusal. The display changes for the scan so that the user receives information about what is happening including the actual names of the samenames.txt and samenames.sinkhole that are created. Note that samenamesXXX.sinkhole is a directory which contains sub-directories which are named the same as the files so there may be directories with a ".TIF" or ".JPG" extension which contains the files of this name that have been deleted. The names of the saved files are constructed by adding a number XXX to the basename then the extension for example it the original file is named "Picture.jpg" it will be named "PictureXXX.jpg" in the sinkhole where XXX is a number and it would be in a subdirectory of the sinkhole named "Picture.jpg". The scanning is done by a second thread. The main thread sets an abort flag if the user decides to abort the scan. The scanning thread periodically checks this flag and aborts back to the main window if it is TRUE. If an error occurs the second thread brings up an information window and then after this has been dealt with by the user the program quits. Some errors are not fatal in which case a message is written in the output file. During the scan the user can either abort the scan or quit completely if a mistake occurred.. Installation ============ No installation is required. Copy snames.exe to the preferred destination. This file (Readme.txt) could also be copied to the same place. Start the programm by clicking on its icon. It can also be invoked by calling its full pathname from the command line. Pattern Matching ================ Wildcards * Zero or more characters ? A single character \x Check x for a match (e.g. if x is a wildcard) [abc] One of the characters in the square brackets [a-z] One of a range of characters in the square brackets [abc(de*f)(ghi?)] C-brackets to check for alternative substrings NOTE: The C-brackets MUST be within [ and ]. The filenames selected for comparison all comply with the pattern chosen. As a simple example, the pattern could be *.jpg and this would cause any file with the ".jpg" extension to be included for comparison. If the List Option "Case-Insensitive" is chosen then the pattern-matching is also case insensitive. If no pattern is entered by the user * is assumed which means all filenames are compared. Actions During Scan =================== The user can select to move all same-named files to the sinkhole or alternatively delete the old modied files or neither (list only). Moving and deleting the samenames are mutually exclusive. If deletion of old modified files is selected, the user has the option of being requested for each deletion (not good for a mass delete) and also has the option to have the deleted files saved to a sinkhole (recommended). The datestamps are also copied. The output file "samenamesXXX.txt" contains a record of what has been done. List Options ============ The user can select DOS style carriage returns with newlines. The user can also select for the scan to be case-insensitive. In addition, the user can select to have the datestamps of the files appended to the filnames in samenames.txt and this now includes the datestamps of files that have been deleted for later comparison with their saved versions. The datestamps are creation, access and last modification date and time. Also the file size in bytes gets included if datestamps are selected. Note that some file systems don't include all the datestamps and they may be the same in this case. Entering the Info ================= To select a drive/directory to scan, click once with the left mouse button on that drive/directory in the choose list to select it then click on "SELECT for SCAN". The full pathname should appear in the chosen list. If this was a mistake, double click on it in the chosen list and it will be deleted from that list. Attempts to place the same pathname twice in the chosen list will fail as will an attempt to place a sub-directory which would already be scanned. If a parent directory is put into the chosen list, its sub-directories are deleted from the list. To view the next "layer" down in the choose directory, simply double click on the entry to view its contents. Note that the user only sees directories or drives. No files are shown. If the drive is unavailable, for example it may be a CDROM without disk inserted, this is information is included in the "DRIVES" display. The type of drive is also shown. To view the chosen list's parent directory click on "PARENT". The ultimate parent is the same as if "DRIVES" have been clicked and the assigned drives are displayed. REFRESH ======= This re-displays the choose list. If the user thinks a change has occured this option could be useful. SCAN ==== This will start the scan process which is in 3 parts. The actions to be performed are displayed as the title of the scan display window. First of all the filenames are collected. Pattern matching is carried out at this stage if needed. Then the files are processed and the unwanted filenames are discarded. Finally, the output file samenamesXXX.txt is created. At this stage deletion/moving is carried out. If needed the files are saved to samenamesXXX.sinkhole before deletion! A "COPYING" message appears while a file is being copied so that the user knows something is happening. This may appear to flicker as files are copied or it may appear to be permanently in place depending on the speed of the copying process, the size of the files and how many files there are of any one filename. Before the scan starts the user is given one last chance to back out. At the end of the scan a "FINISHED" message appears and the user can elect to quit or use "AGAIN" to return to the original window to maybe scan a different directory. Help ==== As of now, this doesn't give any help at all! It just displays a notice. I'll work on this some other time! CANCEL ====== Exits the program. BUGS ==== Probably... None found so far. snames 1.03 (c) David M. Balean 2004, Sunday 7th November 2004 Programmed in C / C++ Compiler : Borland C/C++ David M. Balean 44 Wyong Road Killarney Vale N.S.W. 2261 AUSTRALIA Sunday 7th November 2004 END OF Readme.txt ---------------------------------------------------------------------------