import glob


def file_or_folder(file_name):
    """Check if a glob-able file name is a file or folder. 
    
    Return "file" or "folder" as a string. A pathname that doesn't result in a 
    valid file with glob returns None.
    
    This function accepts only one file at a time!
    """
   
    if len(glob.glob(file_name)) == 0:
        return
    elif len(glob.glob(file_name)) != 1:
        raise RuntimeError("Too many files provided.")
        
    elif file_name[-1] == "/" or file_name[-1] == "\\":
        return "folder"
    else:
        if len(glob.glob(file_name+"/")) == 1:
            return "folder"
        else:
            return "file"