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:
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")From my script
***** RENAMEFILE Error #17426: Cannot read file listing.
***** The server said: Failure writing network stream.
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?
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
then please post the log again.$result=RENAMEFILE("*.jpg","*.jpg.sav")
PRINT("result is:".$result."_end_")
IF($result!="OK")
# The rest of your script goes here....
liked Script FTP? Try our other product Email Parser