Problem

File copyAll operating systems have commands that will create a copy of a file. In this ex...

File copy

All operating systems have commands that will create a copy of a file. In this exercise, you are to create a program that will make an exact copy of a file. Provide the following capabilities:

• Copy only files that end with a “.txt” extension. Generate an appropriate error if something else is specified.

• Using the os module, check whether the source file exists.

• Using the os module, check whether the destination file exists. If so, ask the user if he or she wants to overwrite it.

• If no paths are specified, assume that the file is in the current folder (directory). Otherwise, use the os module to separate the path from the file name. If a path is specified for the destination file, check whether the path exists. Otherwise, generate an error.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 14
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT