Re: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put
Brought to you by:
dbrobins
From: Howard, C. <Ho...@pr...> - 2010-07-21 16:06:49
|
This may be an unhelpful response: It seems to me that you need more handshaking between the two systems to coordinate when the file has safely and completely arrived; either the file is in process or it has already been whisked away. Why not use sftp to send the file to an innocuous place or filename, get the permissions all set, then rename the file to be picked up by the second system's processes? If it has to be so tightly coupled, then maybe go to a web service or remote procedure call or other method of coordination. I expect I'm not really answering your question. > -----Original Message----- > From: Bob Gammage [mailto:sta...@ga...] > Sent: Wednesday, July 21, 2010 6:21 AM > To: ssh...@li... > Subject: [Ssh-sftp-perl-users] Getting SETSTAT failures from sftp-put > > Dear perl-gods, > I have a daemon, written in perl, that SFTP's files to target hosts > based upon an INI file of local-directories to watch, and target-hosts. > It has been working fine for some time. > > I am using Perl v5.8.8, Net::SFTP::Foreign v1.51 & ::Compat v1.36 > > The relevant code is: > %LIBARGS=('user'+>$RHUSER,'port'=>$RHPORT,'late_setperm'=>1); > $SLC = Net::SFTP::Foreign::Compat->new($RHNAME, %LIBARGS); > my $FXSTAT = $SLC->put($SAF, $DAF); > > A new host to which I must now send things is a relatively new SFTP > implementation and has internal processes that move files as soon as > received. I suspect this is the reason I am getting an error: > "Couldn't setstat remote file (setstat)': Specified file path is > invalid" > ...even though the file was received by the remote host. > > This new host also does not permit changing perms on open files so the > "late_setperm" argument must be used (as is required on all my other > hosts). > Given a choice between error 3 "The requested operation cannot be > performed because there is a file transfer in progress" or error 2 > "Specified file path is invalid", I've opted to put in a workaround > (the > logic handling $FXSTAT values) to disregard error 2 from this > particular > host. > I'd prefer eliminating the error. > > I am not talented enough to interpret all that is going on in > Net/SFTP/Foreign/Compat.pm > but I believe it is setting permissions and such, whether that is > needed > or not, and this is what is actually failing. > I absolutely do NOT want to modify Compat.pm or any other parts of the > module, for a variety of reasons. > I am hoping there is some option to disable the setting of attributes. > > Thanks for any help with this. > > -- > RLG, That's me. > Si vis pacem, para bellum > > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Ssh-sftp-perl-users mailing list > Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |