lordgamez commented on code in PR #2289:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2289#discussion_r4514464052
##########
extensions/opc/tests/features/resources/opcua-file-server/file_server.cpp:
##########
@@ -92,17 +97,30 @@ OpenHandle* findHandle(FileContext& context, UA_UInt32
handle_id) {
}
UA_StatusCode openHandle(FileContext& context, UA_Byte mode, UA_UInt32&
handle_id) {
- if (mode & FILE_MODE_WRITE) {
- return UA_STATUSCODE_BADNOTWRITABLE;
- }
- if (!(mode & FILE_MODE_READ)) {
+ if (!(mode & (FILE_MODE_READ | FILE_MODE_WRITE))) {
return UA_STATUSCODE_BADINVALIDARGUMENT;
}
+ std::ios::openmode open_mode = std::ios::binary;
+ if (mode & FILE_MODE_READ) {
+ open_mode |= std::ios::in;
+ }
+ if (mode & FILE_MODE_WRITE) {
+ if (access(context.path.c_str(), W_OK) != 0) {
+ return UA_STATUSCODE_BADNOTWRITABLE;
+ }
Review Comment:
The OPC UA behave tests are currently only running in Linux containers so
adding support for Windows is currently not in the scope of this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]