HI all
I have an issue where I am trying to replicate a folder structure to
another server with a different root folder structure.
Basically what I have is as follows:

Source dir = c:\temp
Dest dir = linux file system (so I need to strip the c:\temp from the
SCP command I am generating)

Here is the script

my $dir = "c:\\temp";
chomp($dir);
print "The folder name is $dir\n\n";
find(\&UploadStuff, $dir);

sub UploadStuff
{
        my $file = $_;
        my $currentdir = $File::Find::dir;
        my $currentfile = $File::Find::name;
        if (!-d $file)
        {
                my $scpfile = $file;
                print "Current Dir before stripping path\t-
$currentdir\n";
                $currentdir =~ s/$dir//i;
                print "scpfile = $scpfile\nCurrent Dir after stripping
path\t- $currentdir\n";
                exit;
        }
}

And output : 
The folder name is c:\temp

Current Dir before stripping path       - c:\temp/SMTPSVCLOG
scpfile = smtpsvc_20100228.log
Current Dir after stripping path        - c:\temp/SMTPSVCLOG



**********************************************************************
Private, Confidential and Privileged. This e-mail and any files and attachments 
transmitted with it are confidential and/or privileged. They are intended 
solely for the use of the intended recipient. The content of this e-mail and 
any file or attachment transmitted with it may have been changed or altered 
without the consent of the author. If you are not the intended recipient, 
please note that any review, dissemination, disclosure, alteration, printing, 
circulation or transmission of this e-mail and/or any file or attachment 
transmitted with it, is prohibited and may be unlawful. This e-mail and any 
files and attachments transmitted with it are unencrypted unless specifically 
advised otherwise. If you have received this e-mail or any file or attachment 
transmitted with it in error please notify Anglo Irish Bank Corporation 
Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone 
no: +353-1-6162000. 
Directors: A.M. Dukes Chairman, A.M.R. Aynsley (Australian) Chief Executive, N. 
Cawley, A. Eames, M.A. Keane, P.G. Kennedy
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Central Bank of 
Ireland. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank 
Private Banking) is regulated by the Central Bank of Ireland. Anglo Irish 
Assurance Company Limited is regulated by the Central Bank of Ireland. 
**********************************************************************
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to