Redmine#4791: use modeoct and do not worry about the file type