Problem with ksycoca on windows
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Fri Feb 8 12:33:59 GMT 2008
> Von: Jaroslaw Staniek
> Christian Ehrlicher said the following, On 2008-02-08 07:11:
>
> > I've a problem on windows - when ksycoca is running / the db is open, I
> > can't execute kbuildsycoca to update the db. The problem is that
> > kbuildsycoca can't overwrite an open file on windows.
>
> Interesting that I've even complained on this during the kdepim meeting :)
>
> Look at src/corelib/io/qfsfileengine_win.cpp:
> bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
> {
> /...
> // All files are opened in share mode (both read and write).
> DWORD shareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
>
>
> So... we perhaps lack FILE_SHARE_DELETE flag here...
>
> If we need that, we could patch Qt (and request accepting the patch by TT)
> to
> add support for FILE_SHARE_DELETE semantics.
>
> See also: [1] http://mg.to/2004/09/30/file_share_delete-in-shell-extension
>
>
> > There're two solutions
> > - let kbuildsycoca create ksyscoca.new and rename the file when db is
> closed
>
> Good idea; Unless I have oversimplified that, as mentioned in [1], with
> FILE_SHARE_DELETE flag the processes will still use the old file though
> unless
> they release handles.
>
> > - open the file in a special mode so I can delete it also someone has an
> > open file handle on it.
>
> > But for this I can't use QFile
>
> Why? because we cannot set sharing flags FILE_SHARE_WRITE |
> FILE_SHARE_READ |
> FILE_SHARE_DELETE as in CreateFile()?
> If we cannot alter the sharing for handle returned by QFile::handle(), we
> could develop a wrapper... but hope the changes in Qt will make it
> unnecessary.
>
Afaik ou can't change a share mode after it was opened - so you either have to patch the qt sources or write your own QFile::open().
My current problem is that I don't know what side effects FILE_SHARE_DELETE has.
Christian
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
More information about the kde-core-devel
mailing list