Problems with KDE_stat on systems where the default locale is not utf-8

Thiago Macieira thiago at kde.org
Mon Dec 1 07:36:56 GMT 2008


Ralf Habacker wrote:
>Christian Ehrlicher schrieb:
>> Thiago Macieira schrieb:
>>> On Thursday 20 November 2008 09:11:22 Christian Ehrlicher wrote:
>>>>> The Qt API will. Or, alternatively, the Win32 API will (the *W
>>>>> functions).
>>>>
>>>> How fast is QFileInfo in Qt4.5? If it's too slow I'm still for a new
>>>> small
>>>> wrapper class for local files inside KDE to handle stat() and
>>>> others. Adding ifdefs everywhere isn't a nice solution at all.
>>>
>>> No improvement.
>>>
>>> The problem is systematic and can't be improved. It can only be made
>>> faster by ditching the file engine support we added in older versions
>>> of Qt. That is, only for Qt 5.
>>
>> I would like to add some new functions to kde_file.h - if possible
>> before 4.2 so we can handle non-encodeable filenames on windows.
>>
>> namespace KDE
>> {
>>   KDECORE_EXPORT int chmod(const QString &path, mode_t mode);
>>   KDECORE_EXPORT int link(const QString &in, const QString &out);
>>   KDECORE_EXPORT int lstat(const QString &path, KDE_struct_stat *buf);
>>   KDECORE_EXPORT int mkdir(const QString &pathname, mode_t mode);
>>   KDECORE_EXPORT int open(const QString &pathname, int flags);
>>   KDECORE_EXPORT int open(const QString &pathname, int flags, mode_t
>> mode);
>>   KDECORE_EXPORT int rmdir(const QString &pathname);
>>   KDECORE_EXPORT int remove(const QString &pathname);
>>   KDECORE_EXPORT int rename(const QString &in, const QString &out);
>>   KDECORE_EXPORT int stat(const QString &path, KDE_struct_stat *buf);
>>   KDECORE_EXPORT int symlink(const QString &in, const QString &out);
>>   KDECORE_EXPORT int unlink(const QString &pathname);
>>   KDECORE_EXPORT int utime(const QString &filename, struct utimbuf
>> *buf); };
>> Maybe I forgot some
>
>close(), read(), write(), lseek(),creat()

Yes for creat, but we should use the three-argument open instead.

As for the others, they do not take the file name, only a file descriptor. 
So there's no need to overload with QString.

-- 
  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/20081201/50fcf349/attachment.sig>


More information about the kde-core-devel mailing list