Why does IFileOperation skip junctions even though I passed FOFX_NOSKIPJUNCTIONS?


The IFile­Operation::Set­Operation­Flags method accepts a number of flags to modify the file operation, among them today's subject FOFX_NO­SKIP­JUNCTIONS. A customer reported that they couldn't get this flag to work: Whether they set it or not, the IFile­Operation skipped over file system junctions.

The term junction evolved two independent different meanings. The shell team invented the term shell namespace junction in Windows 95 to refer to a point in the shell namespace in which one type of namespace extension is grafted into another. For example, a directory of the form name.{guid} serves as the transition point between the default file system namespace and a custom namespace.

Meanwhile, the file system team developed the term NTFS junction point to refer to a directory entry which links to another location.

If you just hear the word junction by itself, you need to use context to determine whether it is short for shell namespace junction or NTFS junction point.

Since IFile­Operation::Set­Operation­Flags is a shell interface, the shell interpretation is more likely (and is the correct one in this case). The FOFX_NO­SKIP­JUNCTIONS flag has no effect on the behavior of the IFile­Operation interface on NTFS junction points; it modifies the behavior on shell namespace junctions.

Comments (5)
  1. Anonymous says:

    HAHAHA, check out the MSDN documentation for IFileOperation::SetOperation:

    FOFX_NOSKIPJUNCTIONS

    Walk into Shell namespace junctions. By default, junctions are not entered. For more information on junctions, see Hard Links and Junctions

    Yes, "Hard Links and Junctions" hyperlink points you to info on NTFS Junctions and links.  I can kind of see the source of the confusion – the reference guide right there points them the wrong way.  

    (doesn't help that IFileOperation doesn't act on files, it should be IShellItemOperation, but hindsight's 20/20)

    [Good catch. The correct link should be "For more information on Shell namespace junctions, see Specifying a Namespace Extension's Location." -Raymond]
  2. RobertWrayUK says:

    [Not unfixed. Thanks. -Raymond]


    Aaargh, that gives me flashbacks of a product I worked on a long time ago, there was some logic in it that said "if (!bNoDropDownInHeader) {" – cruel, just cruel.

  3. Anonymous says:

    @Jack Mathews: Yes, good catch. I hope you'll add the correction through community content, because there's sweet FA chance of Raymond or anyone else from Microsoft doing anything about it.

    [FWIW, the fix is in the pipeline. -Raymond]
  4. Anonymous says:

    Shouldn't the title of this post be "Why *does* IFileOperation skip junctions…" instead of "doesn't"? I agree, double negatives are confusing.

    [Not unfixed. Thanks. -Raymond]
  5. Anonymous says:

    "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" is the only tip I remember using from Windows 95's TIPS.TXT.

Comments are closed.