1

I am using SFTP Library (Renci.sshnet) to connect to SFTP servers through C#, I have to create an interface in c# which downloads the files from the sftp servers and I am stuck in an issue

Issue : What if the file I am trying to download is actually getting pushed from the client the same time, as in may be that file is in progress for uploading, and in that case , my program will throw exceptions, so is there any way I can understand that the file is uploading and can ask user to wait until file is completely uploaded.

I hope, the question makes sense!!

Mohit
  • 11
  • 1
  • you could make a lock file and delete it on completion – BugFinder Jan 29 '18 at 15:14
  • how to understand whether the file needs to be locked or not or getting pushed from the client the same time? – Mohit Jan 29 '18 at 15:18
  • yes as a client uploads if it also makes a lock file, while its there its in use, when its not its done. – BugFinder Jan 29 '18 at 15:20
  • 1
    Have you thought about having the client create a file that is uniquely named e.g. with a date/timestamp appended at the end. Then modify your service to have the ability to read many files? You could rename the file to be prefixed with completed once parsed? – Emma Middlebrook Jan 29 '18 at 15:21

0 Answers0