Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

fsetstat no such file

by dkellyhsu (Initiate)
on Feb 28, 2012 at 19:32 UTC ( [id://956747]=perlquestion: print w/replies, xml ) Need Help??

dkellyhsu has asked for the wisdom of the Perl Monks concerning the following question:

I'm using Net::SFTP and getting this error:
Couldn't fsetstat: No such file or directory at /usr/local/bin/process
the line in question is: $sftp->put("$DCNET_DIR/$infile", "$CNAME_DIR/$infile") || next  ; The script does put the files to the required destination.
I have tried matching the file permissions and matching the group name to the destination directory but still get the same message.
Any help in resolving this will be most appreciated!

Replies are listed 'Best First'.
Re: fsetstat no such file
by salva (Canon) on Feb 28, 2012 at 20:05 UTC
    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.

      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
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://956747]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-19 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found