Get rid of deprecated fileparts function