Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, January 2008
QFile and Win32 path conventions


Message 1 in thread

I am looking at the source code for qfsfileengine_win.cpp in an attempt 
to understand the reasoning behind the handling of Win32 path names, and 
why some formats are supported and others aren't.

For instance, you cannot create a QFile using a "long Unicode" filename 
like \\?\C:\foo (or its Unicode version \\?\UNC\server\share) but it is 
clear that the format was in some respect planned for, because the 
longFileName function will
prepend those prefixes for you.

On the other hand, many of the functions - including that same one - 
look for the prefix "\\.\", which I have never seen before (and this 
could merely be my ignorance).

Does someone know the reasoning behind this?  If nobody here does, I 
will open a ticket on the report page, because one of the things that I 
really need to be able to do is open files by their long-format name 
(among other things, this will let you access files on a drive that does 
not have a drive letter associated to it).

--
 [ signature omitted ] 

Message 2 in thread

Hi,

> For instance, you cannot create a QFile using a "long Unicode" filename 
> like \\?\C:\foo (or its Unicode version \\?\UNC\server\share) but it is 
> clear that the format was in some respect planned for, because the 
> longFileName function will
> prepend those prefixes for you.

Can you show us some code? How are you creating the QFile? From the QFile 
documentation:
	QFile expects the file separator to be '/' regardless of operating
	system. The use of other separators (e.g., '\') is not supported.

The longFileName function is not part of the API, it's an internal helper 
function.

--
 [ signature omitted ] 

Message 3 in thread

Dimitri wrote:
> Can you show us some code? How are you creating the QFile? From the 
> QFile documentation:
>     QFile expects the file separator to be '/' regardless of operating
>     system. The use of other separators (e.g., '\') is not supported.
I will get something sent off tomorrow - it's time for bed for me here :)
> The longFileName function is not part of the API, it's an internal 
> helper function.
Oh, I realize that - that's just where I ended up when I was debugging, 
trying to figure out what was going wrong with my QFile instantiation.

--
 [ signature omitted ]