Wiping files on close: more

Imagine the scenario:

  • file is set to delete-on-close
  • file is mmapped
  • handle is closed
    cleanup path calls MmCanFileBeTruncated, gets FALSE since a view exists, and does not truncate
  • section is unmapped

Will it be the close path who will do the on-delete truncation of this file?


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

I would say that this depends on the implementation.

If it were I, I would issue a flush and purge (you need the flush if you
have a link count > 0) and then do the on disk tidy in the close path
regardless. Why do it in two places?

No doubt the FAT sources have something to say on the matter…