adding file_managed API for making files permanent as well as clean afterwards