fix and extend file utils