KDE linuxisms may confuse CIFS and will cause trouble on Windows

Jaison Lee lee.jaison at gmail.com
Thu Jan 4 21:47:24 GMT 2007

> Until now, removing an open file was a legal thing to do. In fact, not
> only was it quite common, it was even the recommended practice in some
> circumstances.
> I don't think you can remove an open file on Windows. Thus, you can't
> rename something to an open file.
> Each case where this happens has to be analysed: is the renaming
> intentional or accidental? If it's accidental, it's a bug. If it was
> intentional, we have to find a solution for Windows -- which hopefully
> will work on the Unixes as well.

Wow. That sucks. This is like a standard practice on Linux. A lot of
code uses (Q/K)TemporaryFile to generate a name and then passes that
filename to someplace else. Not a problem so long as the original
handle stays open until the new file is created. If you remove the
temporary file and then create a new file afterwards it leaves a
window open whereby (I believe) certain security attacks can be made.
Everything just gets messy.

Someone correct me if I'm wrong, but I really thought that python uses
this method to create invisible temporary files, even on Windows.
Unfortunately I don't have a Windows box handy, but someone may want
to look into how tempfile.TemporaryFile() works in the windows version
of python.

More information about the kde-core-devel mailing list