Hi, I wanted to verify if a symlink exists  and delete it if it exists
My code is:
my $program_path = "c:\\cygwin\\bootp\\linux";
my @program = (
        "$program_path\\$_Globals{LX_VERSION}",
        "$program_path\\install",
        "$program_path\\linux.ram",
        "$program_path\\alize\\install",
        "$program_path\\alize\\startup.txt"
 );

        my $link_prefix = "c:\\cygwin\\bin\\ln.exe -s
$_Globals{CDROM}:/DHS3MGR/$_Globals{TEL_VERSION}/PCMAO/BOOT_RES/BOOTP/LINUX/$_Gl
obals{LX_VERSION}";
my @link = (
        "$link_prefix",
        "$link_prefix\\install",
        "$link_prefix\\linux.ram",
        "$link_prefix\\install",
        "$link_prefix\\alize\\startup.txt"
 );


my @pairs;
push @pairs,
    {  link => "$link[$_] $program[$_]",
      program => $program[$_] }
                                foreach 0 .. $#link;

foreach my $p ( @pairs ) {
    system($p->{link} ) unless -e $p->{program};
}


In fact i wanted to delete :
"$program_path\\install",
        "$program_path\\linux.ram",
        "$program_path\\alize\\install",
        "$program_path\\alize\\startup.txt"
        
  if they already exists to make new one with the new destination.
  
  Thanks.      


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to