FastFat handling of Delete On Close in the cleanup path

Hi All,

I?m trying to understand the cleanup code in FastFat?s and maybe someone would be able to explain the logic there.

When the last handle to a file which is marked for deletion is cleaned up, I can see that both FileSize and ValidDataLength in the FO?s common FCB header are set to 0. Later, AllocationSize is also decreased.

What?s the purpose of updating those fields specifically when the file is being cleaned up and that is the last handle of the file? As far as I understand, new file objects won?t be successfully opened anyway and the user might have opened sections while the file is being cleaned up.

Is there a clear purpose why those fields should be zeroed in addition to clearing the allocation on disk? Or why should the deletion be handled on the cleanup path instead of the close path?