File.stat(file).ftype should be used instead.