efsw icon indicating copy to clipboard operation
efsw copied to clipboard

Check Return Code and Allow Buffer Customization in `ReadDirectoryChangesW()` Function

Open solarispika opened this issue 2 years ago • 1 comments

From https://github.com/SpartanJ/efsw/issues/142#issuecomment-1427591056

Currently, the function that uses the ReadDirectoryChangesW() function does not check its return code, and this makes it difficult for users to detect and respond to failures. Therefore, I would like to request that the function checks the return code of the ReadDirectoryChangesW() function to ensure that it has executed successfully. This will enable users to react accordingly if the function call fails.

Additionally, I suggest allowing users to customize the size of the buffer or provide the buffer themselves. This would provide users with more control over the function, allowing them to tailor the buffer to their specific needs.

By adding these features, users will have greater control over the ReadDirectoryChangesW() function, making it easier for them to detect failures and customize the function to their specific requirements.

solarispika avatar Feb 14 '23 02:02 solarispika

Status update:

  • [x] Custom buffer size: Implemented in https://github.com/SpartanJ/efsw/pull/162
  • [ ] Error handling: Although https://github.com/SpartanJ/efsw/pull/164 refreshes watches when they overflowed, but users are not noticed and some events may be lost. It would be better for user to be informed in this case.

solarispika avatar Nov 11 '23 18:11 solarispika