sindresorhus/recycle-bin

By default, don't permanently delete when recycle bin doesn't exist

Aberta

#8 aberto em 18 de dez. de 2020

 (1 comentário) (0 reação) (0 responsável)C (9 forks)user submission
enhancementhelp wanted

Métricas do repositório

Stars
 (71 estrelas)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

I think that's a better default. We can add a flag to get back the old behavior.

It seems like we can use the FOF_WANTNUKEWARNING flag for this:

Send a warning if a file or folder is being destroyed during a delete operation rather than recycled. This flag partially overrides FOF_NOCONFIRMATION. - https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setoperationflags

It's not immediately clear what they mean by warning and how we could check for that though.

Guia do colaborador