code: def remove_file(filename, recursive=False, force=False):
      
      import os
      try:
          mode = os.stat(filename)[0]
          if mode & 0x4000 != 0:
              # directory
              if recursive:
                  for file in os.listdir(filename):
                      success = remove_file(filename + '/' + file, recursive, force)
                      if not success and not force:
                          return False
                  os.rmdir(filename) # PGH Work like Unix: require recursive
              else:
                  if not force:
                      return False
          else:
              os.remove(filename)
      except:
          if not force:
              return False
      return True
docs: Removes a file or directory.