docs: def set_write_bit(fn):
      # type: (str) -> None
      """
      Set read-write permissions for the current user on the target path.  Fail silently
      if the path doesn't exist.
  
      :param str fn: The target filename or path
      :return: None
      """
  
      fn = fs_encode(fn)
      if not os.path.exists(fn):
          return
      file_stat = os.stat(fn).st_mode
      os.chmod(fn, file_stat | stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
      if os.name == "nt":
          from ._winconsole import get_current_user
  
          user_sid = get_current_user()
          icacls_exe = _find_icacls_exe() or "icacls"
          from .misc import run
          if user_sid:
              _, err = run([icacls_exe, "/grant", "{0}:WD".format(user_sid), "''{0}''".format(fn), "/T", "/C", "/Q"])
              if not err:
                  return
  
      if not os.path.isdir(fn):
          for path in [fn, os.path.dirname(fn)]:
              try:
                  os.chflags(path, 0)
              except AttributeError:
                  pass
          return None
      for root, dirs, files in os.walk(fn, topdown=False):
          for dir_ in [os.path.join(root, d) for d in dirs]:
              set_write_bit(dir_)
          for file_ in [os.path.join(root, f) for f in files]:
              set_write_bit(file_)