
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Take the file system that you created for project 4, and add the following commands.
mkdir dirname Creates a new subdirectory (folder for Microsoft fans)
chdir dirname Changes the current working directory to the new directory
You need to keep track of the current working directory. When your program starts, the current working directory should be the root. This can be changed with the chdir command.
File names for the read, write, append, copy, rename, and delete commands and directory names for the mkdir and chdir commands can be either relative (i.e. starting at the current working directory) or absolute, i.e. starting at the root directory. Absolute file and directory names will have a slash as the first character. Filenames can have one or more slashes in them, referring to subdirectories, just as in unix.
All directories should have an inode; inodes will have the same structure as in the previous project with one change. The fifth byte will indicate the type; this will be either a D for directory or an R for a regular file. This means that there are only 27 pointers to blocks, so the maximum file size is 27 × 32 = 864 characters.
The first entry for every directory should be an entry named .., which has a pointer to the inode of the parent directory. The parent of the root directory is itself. As in project 4, the inode of the root should be in the second block (block 1).
The list command will list the contents of the current working directory. It should display a D for a subdirectory and the size for regular files.
The project is due at 11:59 on Tuesday, November 11.