Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This shoud be done in C programming. Thank you in advacned. 1. Implement a utility program filetype to determine the type of an input file.

This shoud be done in C programming. Thank you in advacned.

1. Implement a utility program filetype to determine the type of an input file. You are not expected to tell according to the extension of the file, because the file comes with or without an extension, or with an incorrect extension. The file signature (magic number) can help. The utility takes only one parameter: the name of the file.

a) You should be able to identify at least the following five file types:PDF,jpg,ELF,tar,Linuxscriptfile.

b) Discuss how to identify a text file.

2. Construct a simple Linux ext2 file system disk image, with block size of 1024 bytes, 16 inodes, 1 group, volume name (disk name) as YourFirstName_YourLastName_437disk.

a) Display your file system specification and its disk layout, including where is your block bitmap, inode bitmap, inode table, your volume name, etc.

b) Show where is root directory (from inode, to 1st block) and its content

c) Create a text file containing 800 of A, 800 of B and 800 of C. Copy it into your disk image as a

file named as abc (use debugfss write). Show where is this newly created file block (from root dir, to inode, to 1st,2nd,3rd blocks) and show the 2nd block of content by dumping segment of disk image specified by 2nd blocks address (use xxd s)

d)Create several new directories and files to reach the system limit. Describe how 16 inodes are consumed.

e) Write a utility program catfilev to find and print out the content of a file specified in this mini file system by its inode. The utility takes two parameters: inode # and the name of the disk image.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

Define and measure service productivity.

Answered: 1 week ago