Housekeeping for files