Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

@ set2.pdf A1.pdf Concordia course-fi Concordia Course , , Error Virtual Machine lns A1.pdf O D file://c 1 8/comp%20348/c/A1.pdf In terms of your task, it

image text in transcribedimage text in transcribed

@ set2.pdf A1.pdf Concordia course-fi Concordia Course , , Error Virtual Machine lns A1.pdf O D file://c 1 8/comp%20348/c/A1.pdf In terms of your task, it is fairly easy to describe. You will be writing a simple search and replace application. Specifically, your job is to (1) find a user-specified text string within a group of disk files, (2) modify those strings and update the original disk files, and then (3) provide a report that indicates what has been done. It will work as follows: The application will take a single command argument. This argument will be interpreted as a text string. For example, if your program was called replace.exe, you might enter replace.exe apple. Note that if you are using the Eclipse C/C++ plugin as your IDE, you can use a "Run Configuration" to specify the command line argument. 1. 2. You will then open each of the files in the current directorv. If you haven't done much programming with files and directories, it isn't especially difficult. That saiod the facilities for doing so in C are somewhat more primitive than those in languages such as Java. First, you will want to make use of the functions associated with . As we discussed in class, these are the basic IO functions, and can be applied not only to the screen and keyboard, but to disk files as well (There are countless online examples of basic CI/O). Here, you will use functions for opening and closing files, reading and writing bytes/chars to and from files, and for checking to see to see if you have reached the end of the file 3. reading files, you must also be able to read the contents In addition to opening and of the directory in order to see what files need to be checked (the current directory - "."). Basically, a directory is just a special type of file that contains a list of the files within it. So the idea is to just loop through the file list, and open and examine each text file (for simplicity, all files used during testing will be text files with a ".txt" ENG 1:56 PM ) US 2018-02-04 O Type here to search ^D

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

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions

Question

In Problems 93104, graph each polynomial function. f(x) = x + x - 2

Answered: 1 week ago