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

Questions for python programing answer each question with

QUESTIONS FOR PYTHON PROGRAMING (answer each question with at least 5 sentences) 1. Discuss the basic elements of a computer program and how they are put together. (Hint: If you write a paper for class, the elements are ...

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

Python codeyour version of pong will be more complete and

Python Code Your version of pong will be more complete and have the following features at a minimum: 1) The scores for each player should be displayed 2) Option for ball speed - Choose between three different speed level ...

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

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

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

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

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

Python program super pongyour version of pong will be more

Python Program: super pong Your version of pong will be more complete and have the following features at a minimum: 1) The scores for each player should be displayed 2) Option for ball speed - Choose between three differ ...

P Programming in Python CS21A Lab I: Lists and Tuples - Files

Programming in Python CS21A Lab I: Lists and Tuples - Files Learning Objectives for this lab include: - Understand list basics including elements and subscripts. - Learn how to find high and low values of a list. - Learn ...

  • 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

WalMart Identification of theory and critical discussion

Drawing on the prescribed text and/or relevant academic literature, produce a paper which discusses the nature of group

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