Bem, descobri por que o Windows leva exatamente cinco segundos.
Eu lancei Process Monitor e linhas filtradas com o nome de um arquivo de teste que eu tentaria excluir ( winplot.exe
- sorry scientists). Após o teste, o log me mostrou que o Windows XP tentou excluir o arquivo seis vezes, com um segundo entre cada tentativa. Você pode vê-lo claramente na primeira coluna abaixo:
18:02:37,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:37,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:37,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:37,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:37,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:38,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:38,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:39,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:39,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:40,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:40,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:41,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:41,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:42,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:42,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:42,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:42,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
Eu não sei o que fazer com essa escolha de programação, exceto pelo fato de parecer algo idiota à primeira vista - desculpe, Microsoft, estou sendo realmente sincero aqui.
*
EDIT: para ser rigoroso, ele tenta apagar sete vezes, mas a última vez segue imediatamente a anterior