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

This assignment will allow you to do a more open-ended

This assignment will allow you to do a more open-ended exploration of online social networking. The goal is to let you use some of the tools we've learned in class on your own. There are some requirements to constrain yo ...

Lab 1 functionslearning objectives for this lab include1

Lab 1: Functions Learning Objectives for this lab include: 1. Understand how functions work. 2. Know how to define and call a function. 3. Learn how to declare local variables. 4. Learn how to pass arguments to functions ...

Write a python script that will implement the following

Write a python script that will implement the following command: merge sourcedirectory1 sourcedirectory2 destinationdirectory The idea is that the contents of sourcedirectory1 and sourcedirectory2 are going to be copied ...

Python programming assignmentin this assignment you will

Python Programming Assignment In this assignment you will write a program which reads a data file containing information in different formats, validates this data, and prints out a report incorporating this data. The dat ...

Write a python program to encode the plain text message and

Write a Python program to encode the plain text message and another Python program to decode the encoded message. Use the following as starter code: # # HW 5 Caesar Cipher: Encoder # Do not modify next 8 lines def encode ...

Pythonprofessor merlin has asked you to help him he has 30

Python Professor Merlin has asked you to help him. He has 30 total students in his class, but he is not sure that all of them took his last exam. He wants to average the grades for his last exam in his medieval literatur ...

Pythondirectory mergerwrite a python script that will

PYTHON Directory Merger Write a python script that will implement the following command: merge sourcedirectory1 sourcedirectory2 destinationdirectory The idea is that the contents of sourcedirectory1 and sourcedirectory2 ...

Objectivesthe objectives of this assignment are- to gain

Objectives The objectives of this assignment are: - To gain experience in designing algorithms for a given problem description and implementing those algo- rithms in Python 3. - To demonstrate the ability to: - Implement ...

Programming problemwrite a python script called passmerger

Programming Problem Write a Python script called passmerger that will merge the contents of two simplified user account tables in a database as described below. The script uses one command line argument that represents t ...

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 ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen