Filewatcher to detect only files that are fully uploaded and are ready to copy

Roja V 1 Reputation point
2020-09-17T12:59:38.13+00:00

We are using the File watcher function in Azure function app to process coping of files from source to destination.

Both, the source ad destination folders are Azure file shares in Azure storage account.

File watcher(azure function app) looks for incoming files in source and triggers the function.

What we experience now is that, as soon as the file information is written to the source older directory ( while the file is still in the process of getting copied ), file watcher detects it as a new file. How do we detect files that do not have any open file handlers and use only those files for further processing.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 45,671 Reputation points
    2020-09-17T15:07:17.293+00:00

    Try opening the file in read/exclusive mode?

    2 people found this answer helpful.