Question: Implement a File System in C++, which would provide following API functions: Function Description x_fopen FILE* x_fopen(const char *filename, const char *mode); Functionality and parameter

Implement a File System in C++, which would provide following API functions:

Function Description
x_fopen

FILE* x_fopen(const char *filename, const char *mode);

Functionality and parameter list like in fopen() function. MSDN: http://msdn.microsoft.com/en-us/library/yeby3zcb.aspx

Instead of pointer to FILE, your function should return pointer to OSFILE a RAM structure which you designed in Part 2 for the management of a file. OSFILE should be used in all other functions instead of FILE when relevant.

File names supported: character string 1 to 64 character long

Only rb, wb, w+b, ab should be supported

x_fclose

int x_fclose(OSFILE *stream);

x_fread int x_fread(void *buffer, size_t nBytes, OSFILE*stream);
x_fwrite int x_fwrite(void *buffer, size_t nBytes, 0SFILE*stream);
x_fseek int x_fseek(OSFILE *stream, long offset, int origin);
x_ftell long x_ftell(OSFILE *stream);
x_remove int x_remove(const char *path);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!