File System Delete


delete is a file system operation that will delete a file.

Deleting Byte

Because the unit of persistent on a file system is the file, you can't delete byte.

If you want to delete byte of your files physically with a file system, you need to:

  • recreate a new one.
  • or manage a ledger of the status of your byte (ie deleted or not)


A ledger is a logical layer of your application above a file system that tracks the status of your data block (deleted or not) so that you don't need to recreate a file for each delete.

The procedure is:

  • you write your data in file by blocks
  • you keep the location of this block in a ledger with their status
  • you mark this blocks as deleted
  • you overwrite the delete block with new data.

Database application implements this kind of logic.

Powered by ComboStrap