elliott-beach / project3

http://www-users.cselabs.umn.edu/classes/Fall-2017/csci5103/PROJECT/PROJECT3/project3.pdf
0 stars 0 forks source link

Kernel.unlink #2

Closed elliott-beach closed 6 years ago

elliott-beach commented 6 years ago

Implement Kernel.unlink(path), which removes the directory entry for path and decrements nlink for the index node.

If nlink is decremented to zero, free all the blocks of the file. If the file is currently open by any process, mark the file so that the blocks will be freed when the file is closed by the last process.

Test: write a program rm.cc which accepts the names of files to be unlinked.

Unlinking a directory is not allowed.

elliott-beach commented 6 years ago

Actually, I think this is easier than kernel.link and might implement this one first. It only involves one path and is simpler overall than creating a hard link.