Use temp file to save metadata for readonly file

Will do.