Creates that many files named after your first name

Assignment Help Operating System
Reference no: EM131220953

Operating Systems- Homework

Purpose

The purpose of this exercise is to understand how creating files affects the available disk space and the available i-nodes on a disk partition on Linux/UNIX.

Assignment

Create and leave a copy of your C program for this assignment on Pond under cs351/hw4.

1) Write a C program on Pond that:

a. Accepts 2 command line inputs: number of files to create, size of each file (in bytes). For example run your program as ./hw4 10 20 will create 10 files of size 20 bytes each. Your program should check and report not only incorrect # of arguments, but also invalid argument values, such as zero or negative.

b. Creates that many files named after your first name (yourname0, yourname1, yourname2... ) and writes the required number of bytes to each file. One simple strategy is to write that many number of characters since each character is one byte. The content of the files isn't important, just the size. Use ls -l to see the result and verify files of correct size were created.

c. After your program is debugged, delete all files created by your program on Pond before moving to next steps. Use command rm command to delete all files. For example rm crystal* will delete all fines whose name start with crystal.

If you think step 1 is too hard, request a copy of the C code from instructor and directly start from step 2 for this assignment. Of course you will receive 0 pts for the C code part of this assignment.

Before moving on to the next steps, do some research on the UNIX/Linux command df. Understand what df does, its usage, and what it outputs.

2) Run the commands
df .; df -i .

to find out how many disk blocks and i-nodes are in use. Save the results (and future results) to document your answers. Be aware that that 1K-blocks is for display purpose only and is not the real block size of Pond file system. The actual block size is bigger.

1110_Screen_Shot.jpg

Read question (a) in step 12 before proceeding to step 3.

3) Run your program and create 10 files, each with 7 characters. Repeat step 2.

4) Run your program again and create 10 files, each with 13 characters. These 10 files will overwrite the 10 files you created in last step as they have the same names. So you still get 10 files under your working directory. Repeat step 2.

5) Run your program again and create 10 file, each with 25 characters. Repeat step 2.

6) You should be able to answer question (a) below now.

7) Delete the 10 files you just created. Repeat step 2.

8) Run your program and create 10 files, each with 8,192 characters.

9) Repeat step 7.

10) Run your program and create 10 files, each with 8,193 characters.

11) Repeat step 7.

12) Using your results, write a few paragraphs explaining each question below. Be specific. For example if list the numbers in comparison or examples involved to support any statement you make.

a. How creating the same files over and over (steps 3-5) affects disk block usage. Do you think the directory entry is reused when a new file overwrites an existing file of the same name? What about i-nodes? What about data blocks? How can you tell?

b. What difference you see when creating 8,192 byte files vs. 25 byte files. Be specific.

c. What difference you see when creating 8,193 byte files vs. 25 byte files. Be specific.

d. How creating any new file affects i-node usage. How can you tell?

e. What is the block size for this disk partition? How can you tell? If necessary try creating more files of different sizes.

f. How is it possible for a program to fail to create a new file on a file system using i-node, even though there are many free blocks still available? Hint, if your answer doesn't include the word i-node, it's not getting full credit

Reference no: EM131220953

Questions Cloud

Fact receive smallville acceptance : Despite these defects, ACME did in fact receive Smallville's acceptance of the ACME offer on May 17th. Please respond to the following questions in your posts and respond to other students' original posts.
Employees working on long-range projects : "Why do you think making progress ranks as the most important factor contributing to motivation according to a recent study? How can managers provide a sense of progress for employees working on long-range projects that might not show results for ..
Find out whether payday lending is legal in your state : Find out whether payday lending is legal in your state and, if so, what restrictions exist. - How stringent are these restrictions compared to those in other states?
Evaluate the impact of unemployment on work motivation : If many unemployed are spending around 2 hours/day looking for work as some research indicates, how would you evaluate the impact of unemployment on work motivation?
Creates that many files named after your first name : Creates that many files named after your first name and writes the required number of bytes to each file. One simple strategy is to write that many number of characters since each character is one byte.
Unemployment on work motivation : If many unemployed are spending around 2 hours/day looking for work as some research indicates, how would you evaluate the impact of unemployment on work motivation?
Restaurant and service as the marketplace : Establishes a system to evaluate the ongoing success of a winery that a operates a restaurant  and service as the marketplace and company dynamics evolve.
Do you expect skew to be significant : Suppose we execute the word-count Map Reduce program described in this section on a large repository such as a copy of the Web. We shall use 100 Map tasks and some number of Reduce tasks.
Whats a myth and whats reality : The Web site of Community Financial Services Association, the payday lenders' organization, has a page on "Myths and Realities" about payday lending. Do you agree with the CFSA about what's a myth and what's reality?

Reviews

Write a Review

Operating System Questions & Answers

  When a process enters the cpu your program must now forkand

when a process enters the cpu your program must now forkand exe a stand alone child process. you must use glxgears for

  Implementation of the electronic medical record

Explain how the effectiveness the implementation of the electronic medical record change will be determined once implemented.

  Create a new user with the name lizardman

Write a command which will move a file named boreworms.txt from a directory named Work to a directory named Archive. Both directories are sub-directories of your current working directory.

  Explain "information architectures" concept in detail

At the least, you need to iterate the questions a couple of times for yourself. Write down your answers, then set them aside for a couple of days and come back to them. If you can do this a couple of times, you'll find that your formulation will b..

  Analyze the security features of linux

Analyze the security features of Linux, Macintosh, and Windows operating systems, and decide which you believe is the most susceptible to hackers based on hacking techniques and attack vectors. Justify your response

  Securing standard telecommunications line vs voip connection

Determine the difficulty(s) of securing a standard telecommunications line vs. securing a VOIP connection?

  What is the application layer protocol

What is the server IP address and what is the application layer protocol involved - what is the client port number for data download?

  How do the named pipes and tcp/ip sockets named libraries

What are the benefits and drawbacks of using ODBC to configure your client applications?

  Indefinite blocking what is semaphore what is the meaning

what is semaphore? what is the meaning of it and how to explain it?meaning of semaphore...... where this type of word

  A machine has a 32-bit address space and an 4-kb page

A machine has a 32-bit address space and an 4-KB page. Suppose a simple OS just boot up on the machine, running a single process. The process uses 2 memory pages for the text and data memory (combined) near the lowest virtual address, and 1 memory pa..

  Give an illustration where strict 2 phase locking is

question 1 give an example where strict 2 phase locking is followed but the resulting schedule leads to deadlock.

  What are the bits that support the demand paging

What are data structures that are used for Demand Paging? What are the bits that support the demand paging?

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