I think that symlinks under Plesk have different permissions
than Unix permissions. As a work-around, I experimented with
Setup::File::Symlink. Instead of checking permissions, I checked for status---either 200 or 304 in this case.
Here I used a dry run. If you want to create a symlink, comment out name and change -dry_run => 1 to 0.
It requires 5.10.1+.
#!/usr/bin/perl
use Modern::Perl;
use Setup::File::Symlink qw(setup_symlink);
my $x = '/root/Desktop/tmp';
my $res = setup_symlink(
name => "create(dry run)",
symlink => "/y",
target => "/$x/x",
other_args => {-dry_run => 1},
status => 200,
exists => 1,
);
print "status: 200\n", if $res->[0] == 200;
print "status: 304\n", if $res->[0] == 304;
|