Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: <JUNCTION>; how to recognize

by pryrt (Prior)
on Oct 10, 2018 at 18:53 UTC ( #1223822=note: print w/replies, xml ) Need Help??

in reply to <JUNCTION>; how to recognize

here is a post I have bookmarked on junctions. I've never found the Round Tuit to use that as a starting point for updating some of my personal scripts which could benefit from being able to recognize junctions1... so hopefully this link will help you get started down the right path.

update 1: this started as a fully fledged thought, but apparently didn't get fully typed: "...recognize junctions, so I don't have the expertise to help you any further... so hopefully..."

Replies are listed 'Best First'.
Re^2: <JUNCTION>; how to recognize
by pryrt (Prior) on Oct 10, 2018 at 21:08 UTC

    Following my link, and doing some more research, I eventually found, which gave a function which spawns out to the cmd.exe DIR /AL command to find junctions and symlinks: so that could work. But it also pointed to Win32API::File, which has GetFileAttributes() and the FILE_ATTRIBUTE_REPARSE_POINT constant, which yields a solution for recognizing/identifying windows junctions:

    use Win32API::File qw'GetFileAttributes :FILE_ATTRIBUTE_'; sub isjunc { return (GetFileAttributes($_[0]) & FILE_ATTRIBUTE_REPARSE_POINT == + FILE_ATTRIBUTE_REPARSE_POINT) ? 1 : 0; }

    (I know, it could be simplified to sub isjunc { GetFileAttributes($_[0]) & FILE_ATTRIBUTE_REPARSE_POINT }, but I like making things more explicit.)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2019-12-09 07:32 GMT
Find Nodes?
    Voting Booth?

    No recent polls found