Question: How to submit the assignment? Deliver 1 file for each of the tasks, also the partial tasks in task 4 . Everything is delivered at

How to submit the assignment? Deliver 1 file for each of the tasks, also the partial tasks in task 4. Everything is delivered at codegrade. The tasks are progression-based. This means that you must use the file you got from task 1 and continue with it in task 2. The most practical thing is perhaps to make a copy of task 1 when you have finished and then work on task 2 from it. And so on. Issued code In this assignment, you will be given code that simulates a simple file system. Run main.py to generate the file system with some example files. The file system as a whole is stored in a file myfilesystem.fs and is divided into blocks. The first block has header information about the file system, and the rest are blocks used for file content. Read comments and documentation in the code to understand the code better. It is also possible to open the file system as raw data by using command xxd myfilesystem.fs in terminal. You will then see an overview of the file system in hexadecimal format. In main.py, some tests have been added that you can run after each task to check if your code works as expected. ATTENTION: Keep as much of the original structure as possible, i.e. do not delete or change functions and function names. When working on the task, you must also think about the effect of your changes on the functionality of the file system as a whole. For example, changing one function can have effects on another.
I need help with this: Exercise 4: hard_link() We have given the file system a whole block for header information. The file names and sizes of the files are stored there. But we don't have enough blocks to fill it completely with file entries. With the remaining space, we will allow creating hard links to existing files. So, a hard link should only be placed as an entry under the maximum number of files in the header. Part A live file: myfs_4A.py Implement hard_link(f, existing_file, linked_file). The function should create a new file entry that points to an existing file. In other words, the function should create a hard link. As part of the released code, the file system has a counter to keep track of how many files the file system has. You will now use the next available space in the system's header to count how many hard links the file system has. This is what _get_num_linked_files and _set_num_linked_files are for, so implement those functions. Also update load() so that it can read the content from a hard link. You may also need to update find_fileno() again depending on how you have implemented the rest of the task. (Hint: The file size is not needed for a hard link since the existing file already has it. You can use this space for something else to implement hard_link.) Part B live file: myfs_4B.py Update remove() like this: If remove() is called for a file, the file's original file entry should be replaced by the topmost hard link pointing to the file. If no such hard links exist, the file should be deleted. If remove() is called for a hard link, the hard link must be deleted. Remember to use NoFile as an exception when the file name does not exist either as a file or as a link.
How to submit the assignment? Deliver 1 file for

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 Programming Questions!