move check if a file should be encrypted to the pre hook
don't call getFileInfo() to avoid to open the same file twice