Return the filename extension of FNAME. If optional argument X is t, then return the basename of the file with the extension stripped off.