File Copy from Solaris System to NT System

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • script2006
    New Member
    • Jul 2006
    • 1

    File Copy from Solaris System to NT System

    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
    }

    }
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    $source_dir="\/\/sstaidevcv001"; # NT System name

    You need something in here to tell the underlying OS that this is a computer name rather than a directory name. If this was Windows then you would be able to do something like

    \\\/\/sstaidevcv001

    However it's not and I don't know how you would do the same thing in *nix which doesn't necessarily share the File and Printer Sharing services that Windows uses.

    Comment

    Working...