Hello
I have a task to write a script that will take a file from solaris system to NT system.
I tried first step to scan the input directory to see whether i can see the NT directory from solaris system. The script is run from solaris system. And I am getting message directory does not exists. Any idea how to solve this problem.
use::strict;
$base_dir="/home/user";
$source_dir="\/\/sstaidevcv001"; # NT System name
$destination_di r="$base_dir/dirtesting";
$file_name = "F*.pos";
scanDir($source _dir);
scanDir ($base_dir);
#moveFile($sour ce_dir, $destination_di r, $file_name);
#createFile($in fo_dir, $okfile);
sub scanDir
{
$src_dir = $_[0];
opendir(DIR, $src_dir) || die "Error: Could not Open Input Directory $src_dir";
opendir(DIR,$sr c_dir);
$name = "(?i)". $file_name;
print "\n $name \n";
my @files = grep (/$file_name/, readdir(DIR));
closedir(DIR);
foreach (@files)
{
$file = $_;
print $file
}
}
I have a task to write a script that will take a file from solaris system to NT system.
I tried first step to scan the input directory to see whether i can see the NT directory from solaris system. The script is run from solaris system. And I am getting message directory does not exists. Any idea how to solve this problem.
use::strict;
$base_dir="/home/user";
$source_dir="\/\/sstaidevcv001"; # NT System name
$destination_di r="$base_dir/dirtesting";
$file_name = "F*.pos";
scanDir($source _dir);
scanDir ($base_dir);
#moveFile($sour ce_dir, $destination_di r, $file_name);
#createFile($in fo_dir, $okfile);
sub scanDir
{
$src_dir = $_[0];
opendir(DIR, $src_dir) || die "Error: Could not Open Input Directory $src_dir";
opendir(DIR,$sr c_dir);
$name = "(?i)". $file_name;
print "\n $name \n";
my @files = grep (/$file_name/, readdir(DIR));
closedir(DIR);
foreach (@files)
{
$file = $_;
print $file
}
}
Comment