in reply to SFTP->RPUT Crashes

I cannot answer the question why your program is crashing, but it looks to me you're trying to re-implement rsync. Why not use that?