2 Replies - 4707 Views - Last Post: 11 August 2005 - 11:19 AM

#1 henxinggan   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-April 05

transfer and renaming file troubles

Posted 10 August 2005 - 02:04 PM

I'm trying to transfer and rename files between a unix directory and an ftp site. I've tried using the command,
$ftp->put($unix_fn, $ftp_fn);
but it's giving me problems, as in it won't work. If the entire name of the file is inserted between the parentheses (ex. /basic/prog/u01/bob.xml) I can use the command
$ftp->put($unix_entire_fn);
successfully, but the name is not changed. I've also tried
$ftp->put($unix_entire_fn, $ftp_entire_fn);
but it tells me that "The filename, directory name, or volume label syntax is incorrect" (the ftp_entire_fn looks like ftp://358.23.118/puthere/bob.xml). I have the most basic Perl version there is. In order to connect to the ftp site, I initially had to have Net::FTP installed. Is there possibly an add-in that makes this work that I don't have? How should the ftp_entire_fn be entered? Should I be leaving out part of the name, like not putting the "ftp" in front?

I also attempted to change the file names once they were out on the ftp site. The first line in the process listed in the book "Perl Cookbook" (contents can be found online at: http://www.unix.org....ok/ch09_10.htm) are as such:
$op = shift or die "Usage: rename expr [files]\n";
When I run this, I receive the "die" message. Is this "shift" function something else that has to be installed?

I'm willing to provide any other details you need to help me solve this. Thank you so very much for your time. This has been driving me nuts and I'm not familiar with Perl add-ons. I appreciate your efforts.

VH

Is This A Good Question/Topic? 0
  • +

Replies To: transfer and renaming file troubles

#2 Nova Dragoon   User is offline

  • The Innocent Shall Suffer, Big Time
  • member icon

Reputation: 38
  • View blog
  • Posts: 6,169
  • Joined: 16-August 01

Re: transfer and renaming file troubles

Posted 11 August 2005 - 10:01 AM

henxinggan, on Aug 10 2005, 03:04 PM, said:


The site you are connecting to, isnt an IP address you need 4 sets xxx.xxx.xxx.xxx you only have 3. Maybe that is the problem?
Was This Post Helpful? 0
  • +
  • -

#3 henxinggan   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 11-April 05

Re: transfer and renaming file troubles

Posted 11 August 2005 - 11:19 AM

I have what you mentioned. I just didn't write it all out. Sorry about that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1