Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: fsetstat no such file

by salva (Monsignor)
on Feb 28, 2012 at 20:05 UTC ( #956750=note: print w/ replies, xml ) Need Help??


in reply to fsetstat no such file

Do you know which SFTP server software is being used at the remote side?

Once the file contents have been transferred, Net::SFTP calls fsetstat in order to also replicate the metadata (permissions and timestamps). But sometimes custom server software does funny things. The truth is that a "No such file or directory" is not an usual error in that context.

You can try also using Net::SFTP::Foreign instead of Net::SFTP, besides being a more feature rich client module, it also offers better debugging.


Comment on Re: fsetstat no such file
Re^2: fsetstat no such file
by dkellyhsu (Initiate) on Feb 28, 2012 at 20:38 UTC
    Thank you for the reply.
    I do not know the software at the remote site. I have looked at cpan site for help and found adding option "copy_perms" should disable the permission problem but when I use this I get
    Can't use string ("copy_perms") as a subroutine ref while "strict refs +" in use at /usr/lib/perl5/site_perl/5.8.5/Net/SFTP.pm line 459.
    Is there a way to not use strict refs?
      Is there a way to not use strict refs?
      Of course. If you don't want strict refs, then don't use them. Unless you tell Perl to use strict refs, Perl will not enable strict refs!

      Having said that, I doubt that disabling strict refs solves your problem. My guess? You need to put quotes around copy_perms.

      You have to write it inside quotes (i.e. 'copy_perms'), but in that case, that an argument is also required, you can use the fat arrow: copy_perms => 1.

      In any case, note that the copy_perms feature is exclusive of Net::SFTP::Foreign. Net::SFTP does not support it.

      In order to know the software used, you can just telnet to the SSH port and it will tell you. For instance:

      $ telnet localhost 22 Trying ::1... Connected to localhost.localdomain. Escape character is '^]'. SSH-2.0-OpenSSH_5.9p1 Debian-2ubuntu2
      I installed Net::SFTP::Foreign - and all now works! Thank you!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://956750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (14)
As of 2014-08-28 16:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (264 votes), past polls