When using folder capture. How does PlanetPress know the file is not currently being written to?

We are configuring PlanetPress Connect to capture XML files from a hot folder (Network Folder) being written to via Microsoft Dynamics AX. From the config option on the Process itself, we can see that the default poll time is 4 seconds, and we can adjust it further down to 1 second (and also zero seconds??, not sure what that means), But what we cannot find out is, does PlanetPress check to see if the file is not being accessed, i.e. still being written to by AX.

Or, because PlanetPress “Moves” the files from the source directory to it’s working directory, can it not do this due to the fact that the OS will not allow the file to be moved until it is not being written to? or doe PlanetPress “copy” then delete the source file.

Due to the nature of our input method and the input files format, we just want to ensure we do not capture partial files.

Thanks.

Ross.

1 Like

Workflow always attempts to get an exclusive lock on the file. If it succeeds, it means the file is not being written to at that moment. If not, it will retry 4 seconds later (or whatever interval you set).

This works well in 99% of all cases. The only time when it may cause issues is when the system writes to the file in chunks, closing it in between chunks. That’s not the ideal way of writing to a file, but it’s possible (think of a log file, for instance). In that case, you don’t want Workflow to grab the file as soon as it can because you might get a partial file. You either have to implement a mechanism that makes the source system write an additional file when it’s done writing to the main file (and have Workflow monitor that additional file), or you may want to implement a longer delay in between checks to make sure the entire file has been written to…