From kde-core-devel Thu Jan 04 21:47:24 2007 From: "Jaison Lee" Date: Thu, 04 Jan 2007 21:47:24 +0000 To: kde-core-devel Subject: Re: KDE linuxisms may confuse CIFS and will cause trouble on Windows Message-Id: <2d720bd30701041347u7c32f84bw90c6d753dd1715b5 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=116794726002135 > 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.