code: def _file_details(filename):
      
      max_head, max_foot = _max_lengths()
      with open(filename, "rb") as fin:
          head = fin.read(max_head)
          try:
              fin.seek(-max_foot, os.SEEK_END)
          except IOError:
              fin.seek(0)
          foot = fin.read()
      return head, foot
docs: Grab the start and end of the file