You might be confusing the Rule Machine actions with the File Manager API proper. Incidentally the Rule Machine “append” action fails in the same way, as I reported. Most likely it is doing the same under the hood.
I get you want to use the File Manager API in your app, but if it is not working there are workarounds, like using @thebearmay driver with your app and take advantage of his append option.
Very easy to call his device commands from your app.
Edit: I use @thebearmay's File Manager with my custom apps. I look at it like a library, and I have one instance of File Manager as a device that I use for file management with more than one app. Just tag the device on to the app and call it as needed.
There's no workaround. Either you take my word for it, or you accept to do the homework
Built-in apps can't be modified to use something like File Manager Driver. For example, the Notifications app logs to a file, no doubt using the File Manager API directly.
For Rule Machine, there could be a workaround, which consists of not using the File actions and instead using a driver like the File Manager driver and calling its custom commands.
Unfortunately, the File Manager driver is not a valid workaround even for Rule Machine, because in the end it uses the same exact File Manager API, and as such is susceptible to the same bug. Unlike the code I shared above, File Manager driver doesn't have a retry mechanism (although it could be added).
There isn't really an append option. Have a look at the code, and you will realize that the append() method is implemented using a readFile() followed by a writeFile() call. You might also notice along the way that those methods don't call the File Manager API directly, instead they use an http endpoint. I believe that's because the File Manager driver was created prior to the File Manager API being made available to Groovy apps and drivers. But it doesn't make any difference, under the hood, those calls all end up running the same code.
If you mean two threads writing to the same file, this is not what I'm seeing, or at least it is not limited to that case. I am seeing failure to write to one file apparently when another distinct file is being written to.
Ok, got it. It is really a bug in 2.0.4.151. Somehow I totally missed that small fact even though it was in the title, i am an update behind and I did not realize it. Good to know, I won't be doing that upgrade yet.
Here I thought we had one of those awkward misunderstandings where people get all pent-up and defensive for no good reason.... Let's hope it get's fixed soon....
And yes, would not want my response to discourage others from responding to posts like this... am I am as thankful for anyone's contribution as anyone else.... just noting how tone can be important in communicating.... (I'm probably diluting the usefulness of my response now....)
I didn't read the original post thoroughly, so it is on me for jumping in and offering help when I wasn't even clear of what the root cause of the issue was at the time. I read it as a user issue, not a hub platform bug, which was wrong.
All good, any hesitation on either side is enough for me.. Was just worried where the conversation may have lead... Glad id would have only ever lead in the right direction...