[SOLVED] Computer Networks-Assignment 1: Concurrent File Copy Program

25.99 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (1 vote)

1.  Goal

⚫ Copy multiple files in parallel.

◼ Using multi-threads ( one thread for each file transfer )

 

2.  Development environments

  • You have to use Python (version 3.6+)
  • TA will evaluate your results on Linux. Python can be run over both Window and Linux, but you must NOT use window OS dedicated APIs.

* You can use simple basic libraries (ex: os, time, thread, etc. ), but must implement the main functionalities by yourself. You are NOT allowed to use some libraries that make it easy to implement your assignment. If you want to know whether a particular library is acceptable or not, ask me via the anonymous google sheet.

=> Allowed library example: “os”, “time”, “thread”

=> NOT allowed library example: “shutil”

 

3.  Functionalities to implement

  • Assume that there are both text and binary files (text files, image files, and video files) in the same directory where your program runs.
  • Get two input strings via a keyboard; one for the source (existing) file name, and one for the destination (non-existent) file name to be copied.
  • Read the source file every 10 Kbytes repeatedly, and store it into the destination file.
  • Must allow a new copy request while doing previous file copies in parallel.

◼    TA will evaluate up to 10 simultaneous file copies.

  • If a file copy is completed, write the file name with the completion time in “log.txt”.
  • The time is assumed to be zero seconds when the program starts.
  • Present the time information up to two decimal places (e.g. 05 )

⚫    Enter ‘exit’ to terminate this program ( instead of a file name )

4.  Sample Results

     Figure 1. Console scree

 

                               3.43  Start copying GoodMovie.avi to GreateMovie.avi

                             10.21  Start copying BadMovie.avi to NotBadMovie.avi

                             32.54  NotBadMovie.avi is copied completely

 

                             47.02  GreateMovie.avi is copied completely

 

                                                                      Figure 2. A sample of log.txt

 

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.