Starting from:

$40

 Computer Networks - Assgnment 1 Solved



Concurrent File Copy Program


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

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

4. 

 
 


 
 
Sample Results

 

 
 
   Figure 1. Console screen

 

 
 
     Figure 2. A sample of log.txt

5.Submission

·              The deadline is 3.21 (Sun) 23:59.

·            For delayed submissions, a penalty of -15 points applies every 24 hours. After 72 hours, you get zero points.

·            In the case of plagiarism, you will receive the F grade.

·              Submit a zip file including a report file and a program file to iCampus

·            Name the program file “StudentID_HW1.py” (ex: 2018001.py)

·            The report file must be the PDF format as “StudentID_HW1.pdf” and include as following;

1)         Describe your development environments: (version of operating system, python version...)

2)         Present how to design your assignment such as data structures and algorithms.

3)         Explain how to test your program by showing the screen capture.

6. Scoring criteria

·              Total 100 points

·            20 points: Get source and destination file names from keyboard

·            20 points: Allow to copy multiple files concurrently

·            20 points: Append every copy completion information in 'log.txt'

·            20 points: The new copied files must be valid. (e.g. possible to play videos)

·            10 points: Termination when entering ‘exit’

·            10 points: The report file should describe your development environment and how to run your programs.

7. Q&~

·              Leave your questions on the google sheet

More products