Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

fatkatie:

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.

...roboticus

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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2019-11-15 23:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (85 votes). Check out past polls.

    Notices?