Cs 652 - programming problem, Business Law and Ethics

Assignment Help:

Q. CS 652 - Programming problem?

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command. This command will look at the contents of two directories and report on the di?erences between them. This includes those ?les that are only in one directory or the other, as well as ?les that have the same name, but have di?erent characteristics as de?ned below. The format of this command will be:

diff [-R] [-c value] directory1 directory2

The options are as follows:

  • -c value, determines what level of di?erence should be reported between two ?les. If not speci?ed, the default is to say that two ?les are the same if they have the same name and are not di?erent types (?le vs. directory). If the option is speci?ed with a value of 1, then two ?les are only considered the same if they also have the same size. If the option is speci?ed with a value of 2, then two ?les are only considered the same if they have the same size and the same exact contents.
  • -R, when present the contents of subdirectories with common names in each directory should also be analyzed in a recursive manner.

The report generated by the program should include three lists of ?les for every pair of directories (or subdirectories in the recursive case). The ?rst list contains those ?les only in directory1. The second list contains those ?les only in directory2. The third list contains those ?les that have the same name in each directory, but are considered di?erent based on the -c option value. These lists should be sorted alphabetically. If a bad option is given to the command an error message should be displayed (including a bad value to the -c option). If anything other than two directories are speci?ed on the command line, an error message should be displayed.


Related Discussions:- Cs 652 - programming problem

Explain the international law and municipal law, INTERNATIONAL LAW AND MUNI...

INTERNATIONAL LAW AND MUNICIPAL LAW   International law is defined as a law between sovereign states and it is implemented to certain subjects such as the States. There are variou

Form of alternative dispute resolution - element of the tort, Most legal co...

Most legal conflicts are settled outside of court, frequently using some sort of dispute resolution. There are times when a party cannot take a case to court until they have made a

Compensation for removal - company management, Compensation for Removal: ...

Compensation for Removal: Subsection (6) provides that nothing in s.185 shall be taken as depriving a removed director of compensation or damages payable to him in respect of

Governing the questioning of witnesses in a court of law?, QUESTION 1 (...

QUESTION 1 (a) Compare and contrast the different rules and features governing the burden and standard of proof in both civil and criminal cases (b) The art of advocacy is n

Prepare tax memo , Patriot, Inc (a C corporation) filed for Chapter 11 bank...

Patriot, Inc (a C corporation) filed for Chapter 11 bankruptcy protection during August, 2011 and has worked out a re-organization plan that was accepted by the Bankruptcy Court an

Principle of statutory provisions, Principle of statutory provisions: ...

Principle of statutory provisions: Most of the cases in which the principle has actually been applied appear to fall within one of the following two classes:- 1. Where the

an express term and an implied term, What is the difference between an exp...

What is the difference between an express term and an implied term? Provide me with an example of each.

Effects or consequences of illegality, Effects or Consequences of Illegalit...

Effects or Consequences of Illegality Misdemeanour Or Illegality renders a contract unenforceable.  However the contract creates no rights and imposes no obligations at the pa

What do you understand by collective bargaining, Question 1: (A) What...

Question 1: (A) What do you understand by Collective Bargaining? (B) What is collective bargaining from: (I) The economic point of view

Case study:employment law, Jonathan has been in the continuous employment o...

Jonathan has been in the continuous employment of Dockland cleaning and laundry Co. Ltd since 1st August 2000. He is also a member and secretary of the Cleaning and Laundry Workers

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd