Testing if a file is complete
I am kinda new to C#, so please bear with me.
What is the easiest way to test if a file is complete?
Let me explain. A company outside is sending us text files throughout the day. They can range is size from several thousand bytes to almost 250 megs. My program runs from a Scheduled Task throughout the day. The short files are usually no problem, but the big ones can be and often are still in the process of being transmitted into the directory from outside.
The way I have been testing this is to try and rename the file. If I get an exception, I know its still writing. Is there an easier way to test that a file is complete?
Thanks
Frank
Answers (2)
0
my task is to upload file with updated version 6th step of following url
https://developer.autodesk.com/en/docs/data/v2/tutorials/upload-file/
0
- var url = "API URL";
- var jsonData = "[{...json data...}]";
-
- using (var client = new WebClient())
- {
- client.Headers.Add("content-type", "application/json");
- var response = client.UploadString(url, jsonData);
- }
Try this
0
I have to integrate this
https://developer.autodesk.com/en/docs/data/v2/reference/http/projects-project_id-versions-POST/
0
What should i pass in query string or in request.AddHeader
0
Please have a look at below thread it might be helpful to you:
https://stackoverflow.com/questions/7929013/making-a-curl-call-in-c-sharp