Modifications to fileutil.py on thrust
Other modifications from thrust
Fixed merge conflict