Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: <JUNCTION>; how to recognize

by roboticus (Chancellor)
on Oct 10, 2018 at 20:29 UTC ( #1223827=note: print w/replies, xml ) Need Help??

in reply to <JUNCTION>; how to recognize


I don't know of any current perl modules or API that would let you work with junctions. If you can't use "dir /aL" to find the information you want, then try Googling "reparse_point", as it seems that Junctions are a specialization of Windows Reparse Points.

I did a little work with them a couple years ago, but didn't dig into it too deeply. If you're just wanting to detect whether a file is a reparse point, though, you should be able to do so with Inline::C. A little of the C code I used to detect reparse points is:

#include <windows.h> #include <winbase.h> int is_reparse_point(const char *file_name) { WIN32_FIND_DATA file_data; HANDLE fHandle = FindFirstFile(file_name, &file_data); // If we can't open the file handle, we'll just say it's not a rep +arse point if (fHandle == INVALID_HANDLE_VALUE) return 0; // Convert the bit into a 0/1 value return !!(fHandle.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) +; }

Note: I just trimmed this out of an old project, and I don't have the time right now to put it together into a simple perl module, but if you want to pursue this, ping me if you have any troubles, and I'll lend a hand.


When your only tool is a hammer, all problems look like your thumb.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1223827]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2020-08-13 02:59 GMT
Find Nodes?
    Voting Booth?
    Which rocket would you take to Mars?

    Results (69 votes). Check out past polls.