Go Down

Topic: Hundreds of temporary files left behind (Read 2 times) previous topic - next topic

vwlowen

Hi,

I've only recently started with the Arduino, so only recently installed the IDE version 1.0.   For an unrelated reason, I was looking in my computer folder c:\users\<xxx>\AppData\Local\Temp\  and, in there, were over 760 folders related to Arduino, each containing a short text file.

It seems that every time the IDE is opened - whether a sketch is loaded or not - the IDE creates three temporary files but only deletes one of them when the IDE is closed.

Is this a bug or have I misconfigured something?  I can't believe that the IDE is supposed to leave its temporay files behind.

Thanks,

John.

Nick Gammon

The Temp folder is supposed to hold temporary files. When do you want them deleted?

By definition, they are temporary.

Better check out your Internet browser cache folder, I bet there are a whole lot more files there.

vwlowen

I understand what you're saying but my Browser has a drop-down menu item which allows me to clear the cache/recent history and, in any event,  there's a logical reason why it's desirable for a browser to cache its recent files.

It shouldn't be necessary for a user to navigate "manually" to an obscure folder that nobody ever visits.  When an application creates temporary files and folders for its own use, personally, I would expect the application to do its own housekeeping. By definition, temporary should be temporary. To answer your question as to when do I want them deleted, that should be a configurable option in the IDE preferences: Immediately when the IDE closes, after xx Days, after 1MB etc.

John.


Jantje

Hi
I checked on my system and there are indeed plenty of files in the temp folder for each run. It is unacceptable to leave so many temp files and even ore unacceptable so many folders.

The idea about temporary folder is that a can separate between core files (written in the installation folder or the my documents folder) and temporary files (written in the temp folder). As a user you can delete the files in the temp folder without risk of deleting crucial system files or personal data.
This is for instance handy when a program crashes and therefore was unable to delete the temporary files. It is however implied that a program writing in the temp folder cleans his files as much as possible. I think leaving 1 folder after each run is unacceptable.

The comparison with the browser is not correct because the browser will read the temporary files during later runs. Most browsers also have a "disk limit parameter" allowing to configure how much disk can be used. So it will never eat all your disk space. It also uses only one folder.

When to clean up? Wen you do not need it anymore. For instance when you close the sketch or when you close the last IDE window.


Best regards
Jantje

PS: having plenty of folders in the temp drive slows down the windows operating system. (I have no experiance with other operating systems but as far as I understand it is a hardware constraint and other OS's will suffer this as well)
Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -

KirAsh4

Plenty of applications will create temporary files when they are launched and used.  However, they also know to delete them when you exit the application.  The Arduino IDE seems to be the only one that's dumb founded in that respect.  0 byte files get created and are never deleted.  This does, after a while, clog up the temp folder, and ultimately will affect the OS itself.

By definition, temp files are exactly that, temporary.  However, by Arduino "standards", they are permanent since they're never deleted.  I call this bad coding practices.  If you write an application that's creating temp files, you should also do your housekeeping and clean them up after the application is closed.  Or at the very least, give the end user tools to manage the temp files, just like any browser does.

I've made it a habit to delete everything in my temp folder every week or two, thanks to using the IDE almost on a daily basis.  It's ridiculous.

By the way, vwlowen, a quicker way to get to your temp folder next time is to click Start -> Run and type in '%temp%' without the quotes.  Quick access.

Go Up