def getsuffix(subject):
    """
  Returns the suffix of a filename. If the file has no suffix, returns None.
  Can return an empty string if the filenam ends with a period.
  """
    index = subject.rfind('.')
    if index > subject.replace('\\', '/').rfind('/'):
        return subject[index + 1:]
    return None
