Поделиться через


Files in Temporary folder

Many a times, I was thinking previously which process might be generating this kind [~DF9094.tmp] of files in temporary folder (which can be opened by typing %temp% in run editbox). But due to one of my customer problem, I came to know its acutally generated as a part of structred storage. So, whenever we use functions like, StgCreateStorageEx or StgCreateDocFile, it will create two files in temporary folder and return us pointer to the IStorage interface from which we can manipulate that structure storage object.

Actually the thing is, before exiting application or after you are done with using the IStorage pointer, you should release the pointer because then and then only those temporary file will get deleted. The customer was having similar kind of problem. After executing the application couple of times, he was ending up having thousands of such temporary files in the temp folder which was annoying.  If IStorage pointer is released at proper place, these temporary files are deleted successfully.