Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider using a word processor. If you were writing high-level code for reading and writing a file, what system calls would you expect? Use C-like
Consider using a word processor. If you were writing high-level code for reading and writing a file, what system calls would you expect? Use C-like pseudocode to structure your answer for in terms of two functions: readFile and saveFile. Hint for pseudocode outline: Use a temp file/variable to buffer the contents of a file. In readFile, read a File to the temp file (can use a global variable), so user can read and then edit. When user saves the temp file, it will be written back to the file. (Slide 10 may help.)
SYSTEM CALLS source file destination file .A SYstem call is a call that invokes some loW level subroutine that likely requires a high level of privilege such that the OS alone offers Example System Call Sequence Acquire input file name Write prompt to screen its service Accept input Acquire output file name Write prompt to screen Consider an example program that makes a Accept input copy of a file. How many system level calls are Open the input file needed? if file doesn't exist, abort Create output file if file exists, abort Loop "Fetch Parameters: read fllename, display message Open: open flles, checks errors (display, Read from input file terminate) Copy: read from src, write to dest Close: close lles, display message, terminate Write to output file Until read fails Close output file Write completion message to screen Terminate normally 10 Image from Operatin tem ConceptsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started