Should close files before removing directory that contains the files