nkg114mc / c-gomoku-cli

Command Line Interface tool for Gomocup gomoku/renju engines
GNU General Public License v3.0
7 stars 3 forks source link

why read only ? #6

Closed lucasart closed 3 years ago

lucasart commented 3 years ago

Is this a copy/paste mistake, or am I missing something ? https://github.com/nkg114mc/c-gomoku-cli/blob/main/src/engine.cpp#L180

dhbloo commented 3 years ago

Thanks for pointing out, I didn't notice it at all. It should be _O_WRONLY.

I guess the reason it runs with no problem is that value of _O_RDONLY constant equals 0, so it actually becomes _O_TEXT in this case, which is a valid flag to the API.

In fact, I found that _open_osfhandle in windows CRT doesn't care about _O_RDONLY or _O_WRONLY at all, mentioned here... (not even documented in MSDN 😢)

lucasart commented 3 years ago

thanks.