[Qt-interest] Can I recognize an NTFS junction?

Constantin Makshin cmakshin at gmail.com
Mon Jul 19 20:18:35 CEST 2010


Since you want to work with platform-specific feature, it's OK to use platform-specific API, isn't it? :)

So I think these MSDN articles may help you:
http://msdn.microsoft.com/en-us/library/aa363940(v=VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa364571(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa364944(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa365511(VS.85).aspx

Something like this may work ("dirIt" is a QDirIterator object):

DWORD attributes = GetFileAttributesW(LPCWSTR(dirIt.fullPath().utf16()));
if (attributes != INVALID_FILE_ATTRIBUTES && (attributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0)
{
    // "dirIt" points to a NTFS reparse point (symbolic link, junction, etc.)
}

On Saturday 17 July 2010 23:14:31 Bob Babcock wrote:
> Is it possible to tell whether a directory in Windows is an NTFS junction?  
> I'm using QDirIterator and I want to control whether or not I look at the 
> directory of a mounted disk.



More information about the Qt-interest-old mailing list