KTemporaryFile::createLocalFile()

Thiago Macieira thiago at kde.org
Thu Jul 5 11:06:50 BST 2007


David Faure wrote:
>static QString createLocalFile() is exactly the same API as the bad
> tempnam: a method that returns a string as opposed to an open file...

I agree with David. This is a bad API. Please do not apply the patch.

I explained to someone this exact same problem last week on IRC. And we 
were talking about Kate and its diff'ing programs. I don't remember if it 
was to Dominik I was talking to, but we ended up agreeing that 
setAutoDelete(false) would suffice.

Again: I object the patch.

>> > > K/QTemporaryFile does not provide this functionality directly
>> >
>> > On purpose.
>>
>> i doubt it.
>
>I am 100% sure that Waldo's intent with ktemporaryfile was on purpose,
>let's see what the TT guys have to say about QTemporaryFile, but I'm
> quite sure they have the same concern.

QTemporaryFile was written with those concerns in mind. It only opens 
files with O_EXCL. However, it does generate predictable file patterns.

>Why would we bother with such an api if we could just get a temp
> filename and then open it the traditional way...


-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070705/73aa4ac6/attachment.sig>


More information about the kde-core-devel mailing list