ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Post here if you experience file transfer problems or unexpected errors.
Hello. Thanks in advance for reading through this.

I have a script that runs a couple of sync operations, and afterwards, it renames all of the .jpg files on the ftp server with the extension .sav (e.g. image.jpg.sav). I regularly experience hiccups in the connectivity to the ftp server, so I'm used to seeing the error 'Failure writing network stream.'

For the SYNC processes, I use the method of handling errors by setting a target prior to the operation and using GOTO to retry the operation in case of a failure. This has been effective.

However, I just got the 'Failure writing network stream' error during a rename operation, and I figured out that the function doesn't actually return anything. When I encounter this error during a rename operation, the script just halts execution. Is there a way to handle this kind of error, or maybe another post that regards the same issue?

Thanks.

From my log:
RENAMEFILE("*.jpg","*.jpg.sav")
***** RENAMEFILE Error #17426: Cannot read file listing.
***** The server said: Failure writing network stream.
From my script
Code: Select all$result=RENAMEFILE("*.jpg","*.jpg.sav")  IF($result!="OK")     IF($rename_attempts==10) STOP      PRINT("Cannot rename server files after 10 attempts. Sending an email and exiting in 5 seconds.")         EXEC($blat_cmd_line_install)      EXEC($blat_cmd_line_3)         SLEEP(5)         EXIT(2)     ELSE         PRINT("Cannot rename server files! Trying again.")       # Jump to the label :startsync to retry         # the connection         GOTO :startrename END IF END IF  
Hello,

Thank you for reporting this problem. I have just checked the ScriptFTP internals (source code) and it is clear that if the error code is correctly reported (as it is shown in your log) it is saved in the returned variable ($result in your script)

Could you modify your script this way to check again the $result contents?
Code: Select all$result=RENAMEFILE("*.jpg","*.jpg.sav") PRINT("result is:".$result."_end_") IF($result!="OK") # The rest of your script goes here....
then please post the log again.