Link to home
Start Free TrialLog in
Avatar of Hanqian
Hanqian

asked on

Why do I still get error code returns even the file uploads by sftp to window server succesfully?

Dear Expert,

When I tried to upload the file from unix machine to remote window ftp server in Perl script, my perl script dies since the code catches the $CHILD_ERROR with value 1536 from the system call even the file is transfered to the ftp server completely.  

Then I tried to do the same thing from the unix command line, and the following is what I have:

I am using public key authorization.
>sftp user@serveraddress
GlobalSCAPE Secure FTP Server * UNREGISTERED COPY *
sftp> put test.txt
test.txt                      |  238B |  238B/s | TOC: 00:00:01 | 100%
chmod_dest_before_transfer: ././test.txt (dst): no such file (server msg: 'File not found')

The first line tells us that the file is transfered completely. But I don't know what the second line means, and I am suspecting that the error caught in the script is from this second line.

Could anyone help on this?

Thansk,
Hanqian

 

ASKER CERTIFIED SOLUTION
Avatar of Hanqian
Hanqian

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adam314
Adam314

You might also want to look at the Net::SFTP module for perl:
http://search.cpan.org/~dbrobins/Net-SFTP-0.10/lib/Net/SFTP.pm
Avatar of FishMonger
I don't have an answer as to why your sftp client tries to do a chmod command without you explicitly issuing the command, but instead of doing a system call, have you tried or considered using the Net::SFTP module?

http://search.cpan.org/~dbrobins/Net-SFTP-0.10/lib/Net/SFTP.pm