467,104 Members | 964 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,104 developers. It's quick & easy.

How to send files ?!

viktorijakup
Hi !!!

I have script, which sends file to current directory, but script sends 1 file in 1 runing script.

I need script, which sends several file, (I select and mark files myself) in 1 runing script.

What I must add to this script.

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use warnings;
  3. use strict;
  4. use File::Path;
  5. use Cwd;
  6. use File::Copy;
  7. use File::Spec::Functions;
  8. #hardcoded 
  9. my $FP = 'D:\conv';
  10. my $TP = 'X:\sgml_db';
  11. my ($from_file, $to_file) = ($ARGV[0], $ARGV[0]);
  12. my $cwd = `cd`;
  13. chomp $cwd;
  14. my ($from_dir, $to_dir) = ($cwd, $cwd);
  15. #rename dir part
  16. $to_dir =~ s/^\Q$FP\E/$TP/;
  17. mkpath($to_dir);
  18. copy(catfile($from_dir, $from_file), catfile($to_dir, $to_file)) 
  19.     or die "can't copy file";
  20. exit 0;
  21.  
Thank you !
Sep 12 '08 #1
  • viewed: 1184
Share:
2 Replies
numberwhun
Expert Mod 2GB
How are you supplying the file names you want to copy? However you do, you would just use a loop to cycle through a list of those files, sending them one at a time.

Regards,

Jeff
Sep 12 '08 #2
viktorijakup
Hi !!!

My method of selecting files is simple.

I open folder, select files with "Panel control commands: Ins or Shift + cursor keys" and run script.

Viki
Sep 15 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Ruben Duarte | last post: by
reply views Thread by CLarkou | last post: by
4 posts views Thread by Wilfried Mestdagh | last post: by
7 posts views Thread by rom | last post: by
14 posts views Thread by Professor Yonce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.