[Qt-interest] QDir::tempPath() printing junk on windows

Gary Coulbourne gcoulbourne at mediaguide.com
Thu Feb 19 23:30:39 CET 2009


Willy P wrote:
> Hey,
> When I
> qDebug() << QDir::tempPath()
> I get this:
> 
> "C:/DOCUME~1/username/LOCALS~1/Temp/
> 
> What's up w/ the ~1's?  How am I supposed to make a usable path out of this?

Windows has two filename formats, short and long.  Short filenames
contain tildes and are an artifact of the creation of VFAT files.  If
you do a dir of "C:\DOCUME~1\username" you'll see the user's files.
That's a perfectly valid path to Windows.  (IIRC, if there were a second
directory with the same first few letters, it would be ~2).

Peace,
Gary



More information about the Qt-interest-old mailing list