%TEMP%中的文件有时会被Windows任意删除 [英] Files in %TEMP% sometimes get arbitrarily deleted by Windows

查看:160
本文介绍了%TEMP%中的文件有时会被Windows任意删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个程序在%TEMP%的子目录中创建一堆临时文件。大部分时间这都按预期工作。但有时文件会因为不明原因而被删除。

We have a program that creates a bunch of temporary files in a subdirectory of %TEMP%. Most of the time this works as intended. But sometimes the files get deleted for unclear reasons.

我们使用procmon.exe跟踪了这一点,并且知道Windows服务"SilentClean"。罪魁祸首。

We tracked this down with procmon.exe and know that the Windows service "SilentClean" is the culprit.

据我所知,在%TEMP%中创建文件的应用程序也负责删除它们。任意清理的临时目录不是很有帮助。

To my knowledge an application that creates files in %TEMP% is also responsible for deleting them. A temporary directory that gets cleaned arbitrarily wouldn't be very helpful.

我们在有足够可用磁盘空间的系统上遇到此问题。因此,我们非常确定没有理由进行某些"紧急清理程序"。开始。

We have this problem on systems with plenty of free disk space. So we are pretty sure there is no reason for some "emergency cleanup procedure" to kick in.

这是否已知行为?如果是这样,应用程序如何确保临时文件在仍然需要时不会被删除?是否有任何文档可以解释发生了什么?

Is this known behavior? If so, how can an application make sure temporary files aren't deleted while they are still needed? Is there any documentation that explains what is going on?

推荐答案


据我所知,创建文件的应用程序%TEMP%也负责删除它们。任意清理的临时目录不是很有帮助。

To my knowledge an application that creates files in %TEMP% is also responsible for deleting them. A temporary directory that gets cleaned arbitrarily wouldn't be very helpful.

Windows多年来都有自动删除TEMP位置旧文件的工具 - 到整理临时文件,因为行为不当(崩溃)的程序留下了

Windows has for many years had facilities to automatically delete older files in TEMP locations - to tidy up temporary files that
have been left behind from poorly behaving (crashing) programs.


这是否已知行为?如果是这样,应用程序如何确保临时文件在仍然需要时不会被删除?

Is this known behavior? If so, how can an application make sure temporary files aren't deleted while they are still needed?

如果您的应用程序需要它们一段延长的时间时间,它们不是真正的"临时",所以将它们存放在不是指定为临时位置的地方。

If your application needs them for some extended period of time, they aren't really "temporary", so store them somewhere that isn't
designated a temporary location.

Dave


这篇关于%TEMP%中的文件有时会被Windows任意删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆