Are files in the temporary folder automatically deleted?

前端 未结 4 1410
我寻月下人不归
我寻月下人不归 2020-12-11 15:01

If I create some file using Path.GetTempPath() - does it automatically get deleted at some stage, or is it up to me to delete it?

4条回答
  •  佛祖请我去吃肉
    2020-12-11 15:40

    Starting with Windows 10, the answer is posibly yes - depending on the machine configuration and the amount of free space on the drive hosting the TEMP folder.

    Specifically, Storage Sense can arbitrarily delete files from the TEMP folder (I found that out the hard way) if enabled by the user. And from what I can tell, it will self-enable on low disk space.

提交回复
热议问题