This modified version of V6 file system will support a file size up to 4GB.
To compile the code run the following command
gcc fsaccess.c -o fsaccess -lm
To execute the complied code run ./fsaccess this will open a command line interface for user to input various file system commands.
These are the following commands we have implemented
- initfs
- cpin
- cpout
- mkdir
- Rm
- q
initfs can take four arguments. initfs 'filename' 'no.of.blocks assigned to the file' 'no of inodes assigned to the file'
Example code will of this format initfs v6file 8000 200
Above code will generate the following output
cmd initfs
v6file
Init file_system was requested: v6file
Total blocks :8000, Total inodes:200
Initialized a new filesystem with 8000 number of blocks and 200 number of i-nodes, size of one i-node 64
Bytes (8192000) written, block size 1024
Directory in the block 5
File system successfully initialized
It prints out the no of bytes written and the directory block in which the file resides.
After the user creates a file system using the initfs cpin from_filename to_filename will take two arguments from filename and to filename.
cpout cpout from_filename to_filename out command takes two command from filename and to filename.
rm command takes input of the filepath that will be removed from the filesystem if it exists Rm filename.
mkdir command takes input of the filepath that will be created in the filesystem if it doesnot exists mkdir filename.
when user enters q the program exits from the file system saving all the changes.