These are likely junctions.
I just tried it on a windows box by using junction.exe
(from sysinternals) to make a junction point, and using this little test program to pinpoint them:
#include <boost/range/iterator_range.hpp>
#include <boost/filesystem.hpp>
#include <vector>
#include <string>
#include <iostream>
int main(int argc, char* argv[])
{
using namespace boost::filesystem;
std::vector<std::string> args(argv+1, argv+argc);
if (args.empty()) args.push_back("C:\\WORK");
for (auto dir : args)
{
recursive_directory_iterator f(dir), l;
for (directory_entry& entry : boost::make_iterator_range(f,l))
{
if (is_other(entry))
{
assert(!is_regular_file(entry));
assert(!is_directory(entry));
std::cout << entry << "\n";
}
}
}
}
Now running this with test.exe "C:\WORK"
printed
"C:\WORK\MyJunction"
Note that the assers
prove that is neither a regular file nor a directory.
In slightly unrelated news, this is rather sweet for directory iteration:
int main(int argc, char* argv[])
{
using namespace boost::adaptors;
std::vector<std::string> const args(argv+1, argv+argc);
for (auto& dir : args)
for (auto& entry : traverse_directory(dir) | filtered(is_valid_file))
std::cout << entry << "\n";
}
Using these rather simple helpers:
template <typename T>
boost::iterator_range<boost::filesystem::recursive_directory_iterator> traverse_directory(T const& dir) {
boost::filesystem::recursive_directory_iterator f(dir), l;
return boost::make_iterator_range(f, l);
}
static bool is_valid_file(boost::filesystem::directory_entry const& entry) {
return is_regular_file(entry) && !is_other(entry);
}
See it Live on Coliru