Author Topic: Temp files not respecting System Temp file Environment Variable location  (Read 907 times)

0 Members and 1 Guest are viewing this topic.

Offline Ethan55

  • Newbie
  • *
  • Posts: 3
I have moved the location of my System Temporary files, through the Windows Environment variable.

I do not want my system SSD hammered with temporary files, buried either under C:\users\'username'\appdata or c:windows\temp.
I have a separate drive which I use for this function.
Avast is completely ignoring the environment variable, and it clearly has the temporary files location hardcoded, as I am still finding leftover Avast junk in these locations.

Avast is big on flagging Junk caused by old files created by OTHER applications.  Can Avast please be updated to use system Enviroment Variable to store its temporary files rather than just presuming to be entitled to use c:\windows\temp. 

As a developer myself, I know this is easily implemented, it's just something which has been ignored by lazy coders not making use of system environment variables.

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11820
    • AVAST Software
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #1 on: November 11, 2021, 11:31:33 AM »
I'm not aware of any hardcoded C:\Windows\Temp file creation in the code.
What filenames are created there?
Even though it won't show much on Windows 10, please provide a Process Monitor log showing the file creations.
Thanks.

Offline Ethan55

  • Newbie
  • *
  • Posts: 3
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #2 on: November 11, 2021, 01:52:09 PM »
Thanks for your reply.  I've just created and attached a screenshot of files created today. Hope this helps.  It seems then that it may be some rogue code lurking somewhere.

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11820
    • AVAST Software
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #3 on: November 11, 2021, 05:59:33 PM »
The screenshot shows that you changed the TEMP variable for Ethan user. Did you also change it for system, in the bottom part?

Online DavidR

  • Avast √úberevangelist
  • Certainly Bot
  • *****
  • Posts: 87637
  • No support PMs thanks
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #4 on: November 11, 2021, 06:04:42 PM »
I haven't changed and windows/avast settings in relation to this area.

That area I associate with the Web Shield, where files are scanned, I have a lot more than that.  What I don't know is if this is only in use for the Web Shield of old.

Typically these files are only locked to be scanned and upon successful scanning if clean then they should be released and cleared from the _avast_ folder, they are also showing 0KB file size (but nothing is truly 0KB. 

However this doesn't appear to be happening with anything close to that as I have 60 files (excluding AvLock.txt) over the last three days.  I would have expected these to have been cleared.

Edit: attached image.
« Last Edit: November 11, 2021, 06:08:24 PM by DavidR »
Windows 10 Home 64bit/ Acer Aspire F15/ Intel Core i5 7200U 2.5GHz, 8GB DDR4 memory, 256GB SSD, 1TB HDD/ avast! free 23.4.6062 (build 23.4.8118.762) UI 1.0.762/ Firefox, uBlock Origin, uMatrix/ MailWasher Pro/ Avast! Mobile Security

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11820
    • AVAST Software
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #5 on: November 11, 2021, 09:06:18 PM »
However this doesn't appear to be happening with anything close to that as I have 60 files (excluding AvLock.txt) over the last three days.  I would have expected these to have been cleared.

Actually, no (though this is completely unrelated to the original question). This was changed - as a small Web Shield performance optimization - in one of the previous versions. When Web Shield needs a temporary file, it opens it - and when it's done with the file, instead of removing it it just shrinks it to zero - and keeps it. Later, instead of opening another file, it reuses the one it already has. (There's a limit to the number of kept files; if there's too many of them, only some of them are kept and the remaining ones are removed as usual). So in the end, those files are only removed when the service (i.e. most likely the computer as well) is shutting down.
The idea is that opening a file is a relatively slow operation (of course in absolute numbers it's very fast - but compared to reusing it, it's still slower). So if this happens very often (and even though you normally can't see the creations and removals, it can happen very often during browsing), it can be an improvement.

Online DavidR

  • Avast √úberevangelist
  • Certainly Bot
  • *****
  • Posts: 87637
  • No support PMs thanks
Re: Temp files not respecting System Temp file Environment Variable location
« Reply #6 on: November 11, 2021, 09:51:39 PM »
Thanks for the clarification.

I was aware that it wasn't exactly the same as the issue reported by the OP, but knowing how it 'used' to work, I was surprised to see any files there other than the AvLock.txt.
Windows 10 Home 64bit/ Acer Aspire F15/ Intel Core i5 7200U 2.5GHz, 8GB DDR4 memory, 256GB SSD, 1TB HDD/ avast! free 23.4.6062 (build 23.4.8118.762) UI 1.0.762/ Firefox, uBlock Origin, uMatrix/ MailWasher Pro/ Avast! Mobile Security