When implementing FileRead/FileWrite SDO commands, a few open questions came to our attention:
Why does FileRead allow to pass an offset ("Address"), but not a length?
When performing a FileRead, the size of the file is only known after receiving the first response-packet - however the buffer for the actual data has to be allocated upfront. For now my generic "oplk"-API is modeled after oplk_readObject() and fails in case the supplied buffer is too small which is suboptimal - any ideas/pointers how the "official" API could/should look like?
Should FileWrite to an existing file append/replace the existing file, or truncate it first before performing the write operation?
For me both scenarios seem to be nescessary: when truncating the file the "address" parameter would not make a lot of sense. However without truncation, files accessed via FileWrite can only grow over time. For me it seems, FileWrite should at least take a "truncate" boolean.
Thank you in advance, Clemens
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What I know, SDO FileRead/FileWrite has not been implemented by any POWERLINK stack so far. That is probably the reason no-one can provide an answer to you from the practical side.
However, your questions are more directed towards the specification of the methods. The right place for such a discussion is the EPSG technical working group. As an EPSG member you can provide your feedback together with a change proposal to the EPSG office (see here).
Best regards,
Wolfgang
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi again,
When implementing FileRead/FileWrite SDO commands, a few open questions came to our attention:
Why does FileRead allow to pass an offset ("Address"), but not a length?
When performing a FileRead, the size of the file is only known after receiving the first response-packet - however the buffer for the actual data has to be allocated upfront. For now my generic "oplk"-API is modeled after oplk_readObject() and fails in case the supplied buffer is too small which is suboptimal - any ideas/pointers how the "official" API could/should look like?
Should FileWrite to an existing file append/replace the existing file, or truncate it first before performing the write operation?
For me both scenarios seem to be nescessary: when truncating the file the "address" parameter would not make a lot of sense. However without truncation, files accessed via FileWrite can only grow over time. For me it seems, FileWrite should at least take a "truncate" boolean.
Thank you in advance, Clemens
Hello Clemens,
What I know, SDO FileRead/FileWrite has not been implemented by any POWERLINK stack so far. That is probably the reason no-one can provide an answer to you from the practical side.
However, your questions are more directed towards the specification of the methods. The right place for such a discussion is the EPSG technical working group. As an EPSG member you can provide your feedback together with a change proposal to the EPSG office (see here).
Best regards,
Wolfgang