Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment Specification

For your first stage you are required to design and develop a UNIX file sharing system. For this task you will be required to develop a simple application in C programming language. The application should include the following components:

• a database file, which stores information concerning a specified set of files contained in a given directory, such as your private working directory (pwd).

• A file monitor component of the application will use this database to verify that the files have not been changed by other users since the last check,

• An alert component which will display if the details of a monitored file have changed since the last check.

Assignment Task

Your assignment is organised into two parts:

Stage 1

In order to guide you through the design and implementation of the required application, perform the following steps including:

1. Write a password protected console-based application, which enables you to create user accounts and specify the name of the file or directory to be shared with other users.

2. Write a simple console-based (ie text-based) menu system to enable the users to select from a set of functions provided by your system including:

a. Create a new user

b. Create a database file, where the implementation requirements for this are defined in bullet point 3 (below).

c. Exit the program

3. Write a function that enables you to create a struct data structure for each file contained in your shared directory. Where each file signature record is stored in a struct of the following form:

struct FileSig {

char name[256]; // File or directory name int mode; // protection and file type int user_id; // User ID of owner

int group_id; // Group ID of owner int size; // file size in bytes

char time_last_mod[50]; // modify time as a string

};

4. Add to your main() function relevant statement(s) to create an instance of the FileSig struct called fileSig. Also use in your main function relevant code to initialise your fileSig struct for two filenames of your choice. Hint: when initialising the fileSig struct ask the user to enter file information/detail rather than by interfacing the Filesystem.


Please note:

For the Stage 1 submission you are not required to do any file I/O for instance to store your file details and/or directory listing. But this will come in Stage 2.

Stage 2:

In order to guide you through the implementation of the new functionality, please follow the following steps including:

Part 1

Extend your program by writing a new C function, which will store and save the logging information into a text file called config.txt.

Thus, you will need to amend your code to validate the username and password details entered by a user against those stored on file.

Consequently, your system should allow access if users have a valid username and password.

Part 2

Extend your program by writing a new C function to take as input a file containing a list of file names (fully qualified path names; one per line) and produce a database file consisting of file signature records. It is upto you to decide how to generate this file - either manually using the ls command, or by other means. In this file each file signature record is stored in a struct of the following form:

typedef struct {

char name[256]; /*File or directory name*/ u_short mode; /*protection and file type*/ short user_id; /*User ID of owner*/

short group_id; /*Group ID of owner*/

off_t size; /*file size in bytes*/

char time_last_mod[50]; /*modify time as a string*/

} fileSig;

Hint: All needed information to perform this task can be found in the inode. To modify time, use function ctime to convert to a human readable string. The function prototype can be as follows:

void mkSigData(, );

where is the name of the file that contains the list of files to get information about. The is the name of the file (your program will create) that will contain the selected inode information for all the files. This database file will contain a series of structs of type fileSig (outlined above), one for each file listed in the fileList.

There must be no other output apart from standard error output associated with system call and function call errors.

Part 3

Extend your program by writing a new C function that will take as input the database file generated in Part 2. The function should simply print to screen the details of each fileSig stored.

Further Requirements

1. For testing purposes, you can create your own files and a file register, which contains the list of these files that require monitoring.

2. All required information about the file apart from the file name is to be obtained from the inode of the file.

3. to make sure the required attributes are defined for your code you should use at least
the following #includes in your source files:

#include

#include

#include

#include

#include

#include

Submission Requirements

Your written report should include the following:

• Your application's requirements list and the application design model showing your system's main components (or functions) and showing data transfer between them. It must match your submitted program source code.

• Also, include screenshots of your running application.

Your source code should include the latest version of your application including:

• New/amended code to include the new password authentication and file I/O.

• Source code for mkSigData function.

• Source code for displayFiles function.

• Headers and source files of any modules defined/used. The following aspects should be considered including:

• Commenting:

o Version control comments, etc.

• Function and module breakup:

o No function longer than one A4 page.

o Put all functions in alphabetic order in your modules.

o Modules containing related functions only.

o Correct use of header files and function prototypes.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91587981
  • Price:- $38

Priced at Now at $38, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Referring to the slides from text book chapter 5 there are

Referring to the slides from text book, Chapter 5, there are two versions of Fibonacci number calculators: BinaryFib(n) and LinearFibonacci(n). The first algorithm has exponential time complexity, while the second one is ...

Suppose the sulfur content of a mineral sample is

Suppose the sulfur content of a mineral sample is determined by complete conversion to Ag2S(s). What mass of sample must be chosen, so that the number of grams of Ag2S(s) obtained is equal to one eighth of the percent su ...

Question a signal was acquired at 200 hz and the spectrum

Question : A signal was acquired at 200 Hz and the spectrum showed a peak at 80 Hz. No anti- Max pts aliasing filter was used. Use the folding diagram to find the lowest 5 possible frequencies that the original signal ma ...

Can someone help me identify how intrustion detection

Can someone help me identify how Intrustion detection system and intrusion prevent system can help protect confidentiality, integrity and availability

Be as specific as you can for the following questions

Be as specific as you can for the following questions, explain each concept in detail and how you arrive at your solutions. This is JUST as important as your actual answers. You are provided a unit square domain where th ...

Query to reterieve data from a customers table in mysql for

Query to reterieve data from a customers table in MySQL for instance who have not placed any orders yet, How to sort results by customers number,How to Modify the query to list customers who have placed fewer than five o ...

Discussion a network-based intrusionimagine you live by

Discussion : A Network-Based Intrusion Imagine you live by yourself on a quiet street. Each day, you leave your house in the morning and drive to work. One day while you are at work, someone breaks into your house by kic ...

Question after you have analyzed the existing material used

Question: After you have analyzed the existing material used by the company for their day-to-day duties, the current Access database, and the additional requirements that the current system does not meet, the following r ...

Question what concerns should be understood about data

Question: What concerns should be understood about data communications being sent over wireless networks? Discuss the pros and cons of one method of transmission, such as Wireless Application Protocol. The response must ...

The marginal revenue and marginal cost functions for a

The marginal revenue and marginal cost functions for a monopolist firm that mines diamonds are given by:

  • 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