CITS2002 Systems Programming | |
|
Project 2 2012 - merge the contents of multiple directoriesWhen members of a software development team work on the same project, they each need copies of the files forming the project. Often each team member will be assigned to work on a subset of the files and, eventually, the individual files will need to be merged together to form the updated project. If the software team have not used version control software, then they must use other tools to merge the project's individual files together. Unfortunately the standard Unix command-line tools do not provide all of the necessary features and, if not careful, the software team could lose some of their changes. The GOAL of this project is to write an ISO-C99 program to merge the contents of one-or-more input directories, leaving the merged result in a single output directory. The developed software tool, named mergedirs, will accept command-line options to direct its execution, and additional command-line arguments representing directory names. Each invocation of mergedirs will require the name of at least one input directory providing items to be merged, and exactly one output directory naming the (possibly new) directory to receive the merged files. Thus, a synopsis of the program's usage, where items appearing within square-brackets are optional, could be:mergedirs [options] indirectory1 [indirectory2 ....] outdirectoryTwo files are deemed "the same" if they have identical pathnames and identical filenames - but they will, of course, come from different "top level" input directories. Thus bob/project2/options.c and carol/project2/options.c are deemed "the same" file, but ted/project2-backup/compare.c and alice/project2/compare.c are not. Note that each input directory, itself, may contain other subdirectories (and so on). Thus, mergedirs performs its comparisions and copying recursively, not just on "flat" directories. Each directory will contain only files and subdirectories - in particular, there will be no links nor symbolic links. Program requirements
Good luck! Chris McDonald. |