[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] Using KTempFile() instead of tmpnam() in kdemultimedia/kscd/CDDialog.cpp
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-11-24 8:06:59
[Download RAW message or body]

On Thursday, November 23, 2000 20:20, Kevin Lo wrote:
> Hi,
>
> This patch is to use KTempFile instead of tmpnam in kscd/CDDialog.cpp.
> If no problem, I will commit it, thanks.
>
> - Kevin

Are you sure this works? tmpfile.setAutoDelete(true) will delete the file when
the tmpfile object gets destructed. Do you want that?

Don't you want to use tmpfile.unlink() instead? Do you need to delete the 
file? 

You might want to use:
    QString tempfile;
    {
       KTempFile tmpfile;
       tempfile = tmpfile.name();
    }
    save_cddb_entry(tempfile,true);

Assuming that save_cddb_entry doesn't mind writing to an already existing 
file. This is free of race conditions.

Cheers,
Waldo

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic