Write a c or c++ program to run on a unix platform

Assignment Help Programming Languages
Reference no: EM132631962

Assignment: 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

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)

Reference no: EM132631962

Questions Cloud

Compute the amount of goodwill recognized : Finally, it is determined that the fair value of the Conchita Division is $1,850,000. Compute the amount of goodwill recognized, if any, on July 31, 2020
Discuss the statement regarding cloud computing : In 500 words or more, consider this statement: For cloud computing to become multi-jurisdictional, it must be separated from politics.
Equilibrium price and quantity of hamburgers : What effect would a decrease in the price of beef (a hamburger input) have on the equilibrium price and quantity of hamburgers
How much cash should A receive : A is personally insolvent after paying the unpaid creditors, but B has personal assets in excess of 100,000.00. How much cash should A receive
Write a c or c++ program to run on a unix platform : 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.
What is the NPV of the purchase : The company's required rate of return is 12%; the company uses straight-line depreciation and taxes are 20%. What is the NPV of the purchase
Where would be necessary to implement security measures : Many business environments have both visible and invisible physical security controls. You see them at the post office, at the corner store, and in certain.
Why variable contribution margin less direct controllable : Variable contribution margin less direct controllable fixed expenses (represents the money available to pay any noncontrollable expenses)
Identify the conclusions of the authors : For this assignment, please review the below attachment and evaluate it in 3 pages (800 words), using your own words, by addressing the following.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd