Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

**This programming assignment is for use in the LINUX/UNIX environment!!

Introduction:
System administration often requires custom written programs and tools. One problem a system admin faces is deleting oversized files on the system.

Assignment Description:
This assignment is to write a program to find files that exceed a given threshold in size. This tool will allow the system admin to find those files that are dominating the usage of the file system.

Program Requirements:
1) The program will take 2 arguments, an options argument and a size argument.
2) The size argument is a number representing the threshold size. For example, if 10 is entered, it will find all files larger than 10 megabytes.
3) The options are to be as follows:
1. -f (this option will display the file name
2. -s (this option will calculate the summary of all file sizes)
3. -t (this option will display the total summary only.
These arguments may be entered in single option fashion or multiple. Example:

$filesize -sf 10

-This will display all files over 10 megabytes and include a summary of all files sizes.
The output is as follows:

80 /home/smith/Tools/decode.tgz
28 /home/smith/Tools/parse_code.a

**NOTE: that decode.tgz is 80 MB and parse_code.a is 28 MB.

4) The program will take the file list in as a stream from the standard input. The "find" command will be used to create the stream, but no options will be allowed to be used.
The "find" command is used here as a simplifying element of the program.
5) The program will use the "stat" system call to filter out dir/block/link/socket files and only return "regular" files.
6) The program will use the "stat" system call to get the file size.



SAMPLE CODE THAT CAN BE USED (You Don''t HAVE to use this):

For POSIX environment:

struct stat sb;
int result = 1; /* result */
if (msg) msg[0] = ''\0'';
if (stat(FN,&sb) == 0) {
if (S_ISDIR (sb)) result = 0;
else if (S_ISFIFO(sb)) result = 0;
else if (S_ISBLK (sb)) result = 0;
else if (S_ISSOCK(sb)) result = 0;
}
}

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9502951

Have any Question?


Related Questions in Programming Language

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

Background informationthis assignment tests your

Background Information This assignment tests your understanding of and ability to apply the programming concepts we have covered throughout the unit. The concepts covered in the second half of the unit build upon the fun ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As