H4 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm trying to traverse a Win32 NTFS directory tree ignoring junctions. Unfortunately for junctions the -d operator returns 1 (i.e. a true value), and the -l operator returns "" (a false value), so I cannot tell it apart from a "normal" directory. The stat function seems not to help either. I've searched up and down the internet but nobody seems to have come across this issue so far.

Any ideas? Thanks!

Replies are listed 'Best First'.
Re: NTFS junction
by ikegami (Patriarch) on Aug 17, 2011 at 18:40 UTC
      Looks promising although I'm not sure that a junction is the same as a symlink. The builtin readlink function returns undef for each directory entry, junction or otherwise. Anyway, I cannot compile the Win32::Symlink module - MS's cl.exe complains about the identifier W2AHELPER which I cannot find in any of the headers which VC++ express installed.

        Looks promising although I'm not sure that a junction is the same as a symlink.

        The module doesn't specifically specify that it uses junctions to create symbolic links, but it's the only kind of symbolic link that's supported by NTFS as far as I know.