Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The C programming language allows for us to easily work with files. In this question you will implement a command-line editor that is capable of

  1. The C programming language allows for us to easily work with files. In this question you will implement a command-line editor that is capable of creating, displaying and manipulating text files. You have a lot of freedom in how you do this but you will need to make informed design decisions and provide justifications for these choices as part of your documentation.

    1. (a) Write a C program that allows a user to perform each of the operations listed below on text files.

      FILE OPERATIONS: Create File - Create a new file with a specified name. Copy File - Create a new file with a specified name and identical contents to an existing file. Delete File - Delete an existing file with a specified name. Show File - Display the contents of an existing file with a specified name.

      LINE OPERATIONS: Append Line - Create a new line of content at the end of a specified file. Delete Line - Delete a line of content at a particular line number in a specified file. Insert Line - Create a new line of content at a particular line number in a specified file. Show Line - Display the contents of a file at a particular line number in a specified file.

      GENERAL OPERATIONS: Show Change Log - Display the sequence of operations performed on all files created by your program, including the number of lines following each operation. Show Number of Lines - Show the number of lines in a specified file.

      You must provide a command-line interface and operate on files in your current working directory but, apart from these requirements, you may implement the program in any way. You should document all design decisions not covered above, e.g., how a user specifies the operation they want to perform.

    2. (b) Implement two additional operations or extensions to the operations listed above. You should provide justifications for the usefulness of the functionalities you introduce.

    3. (c) Write an explanation of your C program. You should incorporate this explanation using detailed code comments and separate written explanations.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago

Question

9. Mohawk Industries Inc.

Answered: 1 week ago