[Qt-interest] QDir failing to list non-ascii directories

Robin Hill qt at robinhill.me.uk
Fri Nov 13 17:56:53 CET 2009


On Thu Nov 12, 2009 at 11:58:07AM +0000, Robin Hill wrote:

> I've got a bit of a strange problem with using QDir.  I've tracked down
> a bug within MythTV to the QDir.entryInfoList call, and this is failing
> to return all entries within the directory (it's skipping entries with
> non-ascii characters).
> 
> I've written a small application (using exactly the same logic) to read
> the same directory, and this _does_ return all entries (running under
> the same user account).  I've attached this application.
> 
> I've looked at the QT documentation and I can't see anything that would
> cause this - there's no filter being set on the QDir object, and I can't
> find any global settings/parameters which would cause this.
> 
> Does anyone have any suggestions on what might be causing this issue (or
> how to work around it)?
> 
Well, it's nothing to do with QT anyway.  I added low-level opendir()
and readdir() calls, and these are returning invalid details for the
non-ascii entries.  This is only happening when the application is being
run via "su" in a login shell (su - USER) though, when run as a
non-login shell (su USER) then it works fine.  My test application works
fine in either case though, so there's obviously something more complex
going on.

Cheers,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill          <qt at robinhill.me.uk>  |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091113/2d6c6a5a/attachment.bin 


More information about the Qt-interest-old mailing list