realXtend/naali — Issue #347: AssetCache fails file operations on too long or non-ascii filenames
Author: jonnenauha
Created: 2012-02-07 16:48:29+00:00
State: open
Labels: Bug

Cache data directory is under users profile. In windows this path is already quite many characters. Our asset cache uses the asset name as is as the filename/url inside this data directory (replacing not allowed chars to $x like : and /). For long asset ref urls this absolute path to the file becomes and issue for QFile and for the windows implementation of the date modified timestamp setter/getter.

I don't have concrete asset urls to test this with, but I would assume on windows it goes over MAX_PATH defined 260 characters mentioned here http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath

This gets printed to our console when the QFile operations fail:

> QFSFileEngine::open: No file name specified

Potential fixes

* Switch windows spesific calls to unicode equivalents.
* Look how to make QFile handle long paths properly as QString (being used here) it is already unicode. I remember Ali saying something on IRC that some weird "//%/" prefix would do exactly this, find out if this is true.