Just piggybacking on this a little bit with one more option, if you don't mind using a windows command, there is a utility in Windows 2003 and higher, and in Windows Vista and higher, and downloadable for lower versions named 'Robocopy'. It's very good for unreliable connections or high latency connections because it will allow restartable mode, automatic retries, and multi-threaded copies. If should be pretty easy to compose the string for the system call to robocopy.
-----Original Message----- From: perl-win32-users-boun...@listserv.activestate.com [mailto:perl-win32-users-boun...@listserv.activestate.com] On Behalf Of Mark Leighton Sent: Wednesday, June 03, 2009 9:06 AM To: perl-win32-users@listserv.ActiveState.com Subject: Re: Advice requested, porting unix perl app to windows If running on Windows, the best practice for transferring files would simply be through the native SMB filesystem. The script should run under a user context (domain is easiest) that has inherent rights to copy files to the second machine (because maintaining username and password credentials in the script would be a security vulnerability). If these are the case, then transferring the file is as simple as: use File::Copy; copy( 'file.dat', '//SERVER2/SHARENAME/file.dat' ); Otherwise, you can use: system( 'net.exe use ...' ); or: Win32::NetResource::AddConnection() to map a drive first. Cheers, Mark --- Mark Leighton CLIC LAN Supervisor, Information Commons, University of Toronto E-mail: mark{DOT}leighton{AT}utoronto.ca -------- Original Message -------- Subject: Advice requested, porting unix perl app to windows From: Dennis Daupert <ddaup...@csc.com> To: perl-win32-users@listserv.ActiveState.com Date: Wednesday, June 03, 2009 10:42:03 AM > Hello group, > > Most of my perl programming is on unix; my windows knowledge is limited. > So, please be gentle ;-) > > I have an app that produces data files on one unix machine, then uses > scp to move those over to another machine for further processing. The > system architecture dictates the two-machine arrangement. Management > has asked me to port that app to a windows-based system with the same > two-machine architecture. > > I don't know of a free (as in both beer and non-beer) windows equivalent > to scp OR sftp. I'm seeking advice on a solid, dependable, and secure way > to move > files between machines without incurring additional expense. I've wondered > whether > there may be Perl modules that will map drives and copy files across that > would > do so on an automated schedule, and I've been searching CPAN. But before > heading too far down that path, I thought I'd ask the list for advice. > > best, > > /dennis > > ------------------------------------------------ > Dennis Daupert, PhD > Senior Systems Development Professional -- CSC Account > CSC > > GOS | o: 1.317.298.9499 | ddaup...@csc.com | www.csc.com > > This is a PRIVATE message. If you are not the intended recipient, please > delete without copying and kindly advise us by e-mail of the mistake in > delivery. > NOTE: Regardless of content, this e-mail shall not operate to bind CSC to > any order or other contract unless pursuant to explicit written agreement > or government initiative expressly permitting the use of e-mail for such > purpose. > > _______________________________________________ > Perl-Win32-Users mailing list > Perl-Win32-Users@listserv.ActiveState.com > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs