Categories: Uncategorized

Advanced Operating System

 Write a C or C++ program to run on a Unix platform. This program will take three arguments. The first argument will be the pathname of a directory on the system. The second argument will be a character string. The third argument is the maximum number of output lines, N. Your program should display at most N entries in the directory tree in a text file.

You need to implement three system calls: Open, Read, and Stat

Don't use plagiarized sources. Get Your Custom Essay on
Advanced Operating System
This is a Snippet Preview, get a Complete Solution Here
Order Essay

Details of the system calls are given below. You can also use man command pages to learn more about these system calls.

1. Open system call: DIR *opendir (const char *dirname) Opendir system call opens a directory and returns a pointer to a struct DIR. DIR represents a directory stream, which is an ordered sequence of all directory entries in a particular directory.

2. Read system call: struct dirent *readdir (DIR *dirp) Once the directory has been opened, you can read the directory with readdir system call. Each time you call readdir system call, it returns another entry in the directory.

3. Stat system call: int stat (const char *path, struct stat *sb) Once you have the name of an entry, you can use the stat system call to get more information about it. stat function takes two arguments, the first is a path name and second is a pointer to struct stat, which contains information about the file.

 Guidelines and Requirements 

1. You can use either C or C++ for this programming assignment.

2. Your program should run on a UNIX platform

3. Add comments (about the function/variable/class) to your code as much as possible

4. Zip your project including source file(s) and input text data files (if any)

Phyllis Mugure

Recent Posts

Introduction to psychology | Assignments Market

ASSIGNMENT 08 S01 Introduction to Psychology I Directions: Be sure to save an electronic copy…

4 years ago

Education | Assignments Market

Include a comprehensive, thoughtful and critical analysis to the arguments and perspectives of the readings…

4 years ago

Session 2 Discussion | Assignments Market

Discussion Prompt: Plagiarism As a writer, one of the gravest errors to make is to…

4 years ago

CJL Writing Questions | Assignments Market

Question 1: Write a Hypothetical. Write a legal memorandum analyzing what happened in the following…

4 years ago

short HW all the questions below | Assignments Market

You work at Happy Joe's family restaurant and want to see if customer meal satisfaction…

4 years ago

321 solve … | Assignments Market

The Assignment must be submitted on Blackboard (WORD format only) via allocated folder. Assignments submitted…

4 years ago