I need to write a script that controls an ftp session. The session must download a small txt file, then upload a larger zip file, then check for the presence of an update file and if exists, download it. The issue is how to obtain the status codes from the ftp session so we can determine what to do next in the script session.