Design and develop a unix file sharing system for this task

Assignment Help Application Programming
Reference no: EM13380304

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.

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(<fileList>, <database>);

where <fileList> is the name of the file that contains the list of files to get information about. The <database> 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 <stdio.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <unistd.h>

#include <string.h>

#include <stdlib.h>

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.

Reference no: EM13380304

Questions Cloud

Question 1 write a program that can be used as a math tutor : question 1 write a program that can be used as a math tutor. the program should display two random numbers between land
Create a text file that contains account number 9-digit : create a text file that contains account number 9-digit number type one of the two types current denoted by cu or
Why are timestamps used in the kerberos protocolnbsp assume : why are timestamps used in the kerberos protocol?nbsp assume that alice shares a secret s with her companys server
User interface design the user interface provides : user interface design the user interface provides interaction between the user and the application. choose one of the
Design and develop a unix file sharing system for this task : design and develop a unix file sharing system. for this task you will be required to develop a simple application in c
1 what factors affect storage speed2 what features should : 1. what factors affect storage speed?2. what features should you look for in a printer? describe at least four in
Question 1if some of our regular customers become : question 1if some of our regular customers become dis-satisfied because of service failure. what can you do to convert
Inventory management systemsyour sister owns a small : inventory management systemsyour sister owns a small clothing store. during a conversation at a family dinner she
Lockhart corporation is a calendar-year corporation at the : lockhart corporation is a calendar-year corporation. at the beginning of 2013 its election to be taxed as an s

Reviews

Write a Review

Application Programming Questions & Answers

  In this project you will create an application to run in

in this project you will create an application to run in the amazon ec2 service and you will also create a client that

  Imagine that your company has decided to expand to the web

imagine that your company has decided to expand to the web. you want to reuse some data entry code that has been

  1 here is a short program it prints out the value of a

1. here is a short program. it prints out the value of a variable x. ernie and bert disagree about what will be printed

  If the user wants to read the input from a file then the

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

  Question 1we are given the following knowledge base of

question 1we are given the following knowledge base of travel informationnbspbycaraucklandhamilton.

  Basic requirementsscreen one has three edittext views and

basic requirementsscreen one has three edittext views and one button.the edittext views allow you to enter a students

  Create a application using the mvc architecture no

create a application using the mvc architecture. no scripting elements are allowed in jsp

  Rtl sa is a company which develops bespoke solutions for

rtl sa is a company which develops bespoke solutions for the rubber industry. they produce both rubber compound which

  Design a program that models the worms behavior in the

design a program that models the worms behavior in the subsequent scenarioa worm is moving toward an apple. each time

  Problem build a class for a type called fractionnbspthis

problem build a class for a type called fraction.nbspthis class is used to show a ration of two integers.nbsp include

  Part - 1 object-oriented designwrite a program that allows

part - 1 object-oriented designwrite a program that allows an instructor to keep a grade book. each students has scores

  Soda vending machine designnbsp design a soda vending

soda vending machine designnbsp design a soda vending machine that can deliver three kinds of soda a b and c. allnbsp

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