Without using the system function to call any bash commands

Assignment Help Python Programming
Reference no: EM13346377

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 differences 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 different 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 difference 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 different 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 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 speci?ed on the command line, an error message should be displayed.

Reference no: EM13346377

Questions Cloud

Write a paper about what normal operations of the system : write a paper about what normal operations of the system that has gone wrong with obesity. then the effects of obesity
Exercise prepare a flexible budget gator divers is a : exercise prepare a flexible budget gator divers is a company that provides diving services such as underwater ship
At thermo fisher scientific we fulfill our mission by : at thermo fisher scientific we fulfill our mission by working everyday in accordance with our values which we can the 4
Question tweedle pty ltd is a company that lays down : question tweedle pty ltd is a company that lays down railway track in newly developing countries. a b c and d are the 4
Without using the system function to call any bash commands : without using the system function to call any bash commands write a python program that will implement a simple version
A quoted company is considering several long-term sources : a quoted company is considering several long-term sources of finance for expansion into new foreign markets. critically
A jayantha commenced business on 1 january 2010 with equity : a. jayantha commenced business on 1 january 2010 with equity of 100000. during the year ending 31 december 2010 he paid
Task 1you are part of a global financial services company : task 1you are part of a global financial services company that has offices in london new york tokyo and singapore. its
On a graph this is demonstrated by a series of hills and : on a graph this is demonstrated by a series of hills and valleys corresponding to the expansion and contraction of

Reviews

Write a Review

Python Programming Questions & Answers

  Improve the code for the haunted house game

Improve the readability of the code by improving the function names, variables, and loops, as well as whitespace. Document these changes in your journal and define a win condition for the game, for example, collecting all items and returning to the..

  Segment that prompts the user for an arithmetic operator

The variables x and y refer to numbers. Write a code segment that prompts the user for an arithmetic operator and prints the value abtained by appying that operator to x and y.

  The dictionary order based on the ascii order

Needless to say, the dictionary order based on the ASCII order is not what a real-world indexing software wants. So, we want to implement the dictionary order of strings in the standard wa

  Cleint software so that it does not display

Rewrite the cleint software so that it does not display an echo of a message sent by the users. Maybe it means that each time a user tries to send a private message that same message is also sent back to them? summary: stop that from happening?

  Write python code that will execute a list

Write python code that will execute a list of functions with supplied parameters and report the observed runtime for each function run. Assume that the input file has a list of strings like so:

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  The computer game function collision

The computer game function collision () checks whether two circular objects collide; it returns True if they do and False otherwise. Each circular object will be given by it's radius and the (x,y) coordinates of it's center.

  Reinforce topic material on simple functions

Select 3 sets of test data that will demonstrate the correct 'normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write a program that counts the frequencies of each word

Write a program that counts the frequencies of each word in a text, and output each word with its count and line numbers where it appears. We define a word as a contiguous sequence of non-white-space characters.

  Write a loop that counts the number of space

Write a loop that counts the number of space characters in a string. Recall that the space character is represented a

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

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