Ask Question, Ask an Expert

+1-415-315-9853

info@mywordsolution.com

Ask Python Expert

1. Programming problem.

Without using the system() function to call any bash commands, prepare 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 differences between them. This includes those files that are only in one directory or the other, as well as files that have the same name, but have different characteristics as defined 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 difference should be reported between two files. If not specified, the default is to say that two files are the same if they have the same name and are not different types (file vs. directory). If the option is specified with a value of 1, then two files are only considered the same if they also have the same size. If the option is specified with a value of 2, then two files 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 analysed in a recursive manner.
The report generated by the program should include three lists of files for every pair of directories (or subdirectories in the recursive case). The first list contains those files only in directory1. The second list contains those files only in directory2. The third list contains those files that have the same name in each directory, but are considered different 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 specified on the command line, an error message should be displayed.

Python, Programming

  • Category:- Python
  • Reference No.:- M9905

Have any Question? 


Related Questions in Python

Python assignmentwrite a python program to crack a password

Python Assignment Write a Python program to crack a password in the Linux /etc/shadow file. Write a program using Python to implement a password cracker for Linux. You should utilize a dictionary (small - English) to cra ...

Programming assignments1read python tutorial

Programming Assignments 1. Read Python Tutorial (https://docs.python.org/3/tutorial/index.html) sections 4.6 to 4.8. 2. Write a Python function that checks whether a passed string is palindrome or not. Note: A palindrome ...

Problem descriptionthe previous assignment assumes its

Problem Description The previous assignment assumes its input includes spaces between every token in an expression, but many programmers tend not to use so many spaces, if the expression is unambiguous. For example, both ...

Project add time and object interaction to the

Project: Add Time and Object Interaction to the Simulation Addendums Addendums to the project will be posted at: https://www.cs.uoregon.edu/Classes/16S/cis211/Projects/P4/P4.html This specification is very detailed, and ...

Write python code to solve the following problem1 write a

Write Python code to solve the following problem: 1. Write a Python program that prompts the user for his/her amount of money, then reports how many Nintendo Wiis the person can afford, and how much more money he/she wil ...

Python homeworkyou will write a program that acts like a

Python HomeWork You will write a program that acts like a simple calculator for binary numbers. You should read in a string of input that has the format: number operator number. Each of the numbers should be presented in ...

Introductionthe assignment is to design a service oriented

Introduction The assignment is to design a Service Oriented Architecture-based solution for a given domain. You must show a good understanding of Service Oriented principles. In addition you must show knowledge and under ...

Taskyou are to plan and then code a console-based program

Task: You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selection, repetition, file input/out ...

1 alternating sumsprovide code for an integer-valued

1. Alternating sums Provide code for an integer-valued function altSumSquares(n) that calculates and returns as its value the alternating sum of the squares of the first n positive integers. You may not use a formula to ...

1 read python tutorial httpsdocspythonorg3tutorialindexhtml

1. Read Python Tutorial (https://docs.python.org/3/tutorial/index.html) sections 1 to 4.5. 2. Write a Python program that prints out a table of values of all even powers of 2 from 2**0 through 2**32. For each value, prin ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

A cola-dispensing machine is set to dispense 9 ounces of

A cola-dispensing machine is set to dispense 9 ounces of cola per cup, with a standard deviation of 1.0 ounce. The manuf

What is marketingbullwhat is marketing think back to your

What is Marketing? • "What is marketing"? Think back to your impressions before you started this class versus how you

Question -your client david smith runs a small it

QUESTION - Your client, David Smith runs a small IT consulting business specialising in computer software and techno

Inspection of a random sample of 22 aircraft showed that 15

Inspection of a random sample of 22 aircraft showed that 15 needed repairs to fix a wiring problem that might compromise

Effective hrmquestionhow can an effective hrm system help

Effective HRM Question How can an effective HRM system help facilitate the achievement of an organization's strate