KTemporaryFile::createLocalFile()

Oswald Buddenhagen ossi at kde.org
Thu Jul 5 18:08:24 BST 2007


On Thu, Jul 05, 2007 at 10:59:32AM -0500, Matthew Woehlke wrote:
> What is wrong with this doing this?
> 1. open file
> 2. run diff program that outputs to stdout
> 3. in your process, read stdout from (2) and write to the file in (1)
>
it eats resources for no good reason.

> 4. tmpfile.fileName();
> 5. run Kompare, passing to it (4)
> 6. when done with Kompare, close the file

it would not hurt to setAutoDelete(false) and close() the temp file only
in the success case - to make forgetting to delete the file harder. when
something is changed, that is, as currently everything is perfect. ;)

> Of course, plumbing everything together with pipes would be better still.
>
indeed.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.




More information about the kde-core-devel mailing list