1

I want to upload a file to SFTP server using Python script and create {filename}.done when the file transfer completes to make sure transfer was successful. Can anybody help me on this how I can achieve this task?

And, by the way, I already have working code to transfer the main file using paramiko python module. I just need suggestion on how to automatically create .done file.

Suggestions will be highly appreciated.

2
  • What exactly are you asking here? Do you have working code to transfer the first file? Or are you asking generally how to transfer files? Please edit your question to include any relevant source code that you have. Commented Mar 24, 2017 at 13:55
  • Thank you stackoverflow.com/users/13317 for the suggestion. I just updated the question accordingly. Commented Mar 24, 2017 at 14:14

1 Answer 1

1

Just open the file you want to create and close it.

f = sftp.open(FOLDER + '/test', 'w')
f.close()

By the way, there are some examples of this on Paramiko test cases

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you so much stackoverflow.com/users/172306/fn . I really appreciate your help.
@IshworBhatta On Stack Overflow, we thank by accepting the answer!
@MartinPrikryl Thanks for reminding me. I just forgot to do so. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.