develooper Front page | perl.perl5.porters | Postings from October 2011

RE: [perl #99704] Add symlink support for Win32

Thread Previous | Thread Next
Jan Dubois
October 26, 2011 11:00
RE: [perl #99704] Add symlink support for Win32
Message ID:
On Wed, 26 Oct 2011, Craig A. Berry wrote:
>> Note though that running under an administrative account is not
>> enough; the perl process would also have to be run with elevated
>> privileges as well.
> This complicates testing as well. There are various places in the test
> suite that check for $Config{d_symlink} to know whether they can use
> symlinks in testing. That would no longer be sufficient as you'd have
> to know whether you're running with privileges to know whether you can
> run those tests.

You can call Win32::IsAdminUser() to figure out if you are running
with administrative privileges.

>> The other complication is that for NTFS symlinks you need to know if
>> the target is going to be a file or a directory when you create it.
>> So what do you do when the target does not yet exist when symlink()
>> is being called?
> And yet another complication is that as far as I can tell there is no
> CRT support for symlinks, so not only is there no lstat(), but none of
> the usual functions that operate on files follows links. So there
> would have to be a lot of wrappers or overrides in order to provide
> the functionality people normally expect from symlinks. Not
> impossible, but it seems like a better place for this support would be
> in the CRT rather than in Perl.

I don't think this is true:

We would still have to implement our own lstat(), but that too should be
possible.  But given the limitation of having to run with admin privs this
seems like a low priority for all the effort involved.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About