I need some pointers on how to solve a problem. I want to create temporary files then open them with the default program for that type. So far so good, however I need some way of deciding when the file is no longer needed so it can be removed. I'd prefer some method of removing it as soon as possible. I guess I could manage a list of all created files then remove them when the program exits but given some time that could result in tons of tmp files. Any ideas of other ways?