Update file according to directory changes