In C++:OperationsCreate/Store - give filename, text to saveDelete a fileRenameCopyOpen/ReadListImplementationThis is to be implemented in c++ within a file. All data concerning the file system must be...

1 answer below »
In C++:



Operations





  1. Create/Store - give filename, text to save





  2. Delete a file





  3. Rename





  4. Copy





  5. Open/Read





  6. List





Implementation



This is to be implemented in c++ within a file. All data concerning the file system must be stored inside the filesystem itself. All file contents will be in text format, such as short sentences. Files can be limited in size (if that helps, for example to 100 bytes), but must be greater than one block. A block size of 10 would be appropriate.





Parts of File System





  1. File Allocation Table (use a fixed size of File Control Blocks, maybe 20)





  2. Free Allocation Table (array of bits)(pointers to clusters)(array of open block starting points with number of blocks free) (non contiguous is Linked List)





  3. Actual Data (contiguous) (clusters of x size) (non contiguous Linked List)







Operations Discussion





  • Create/Store File






    • Provide filename and content





    • Ensure filename is unique





    • Decide if we have space for the file, locate location to place file





    • Copy file into location





    • Remove location from Free Allocation





    • Create a entry in the FAT






      • File Control Block: filename, starting location, creation time, size







  • Delete File






    • Provide filename





    • Ensure filename exists





    • Locate beginning of file





    • Mark allocated data as being free space in Free Allocation Table





    • Delete File Control Block






  • Rename






    • Provide filename










Answered Same DayNov 18, 2022

Answer To: In C++:OperationsCreate/Store - give filename, text to saveDelete a...

Banasree answered on Nov 18 2022
42 Votes
Operations:
#include
#include
using namespace std;
int main()
{
int sta
tus;
char filename[00];
cout<<"Enter the Name of File:";
cin>>fileName;
status = remove(fileName);
if(status==0)
cout<<"\nFile Deleted Successfully!";
else
cout<<"\Rename!";
cout< return 0;
}
Implementation – Create a dummy file in system. Select the file name under Enter the Name of File.
Parts of a file system:
// Online C++ compiler to run...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here