Comments (6)
That's a totally reasonable request. I've got to think of a good API for that and make it as a non-breaking change. If you have some minutes can you open a ticket for this specific feature request? Thanks
from efsw.
When you first call ReadDirectoryChangesW, the system allocates a buffer to store change information. This buffer is associated with the directory handle until it is closed and its size does not change during its lifetime. Directory changes that occur between calls to this function are added to the buffer and then returned with the next call. If the buffer overflows, ReadDirectoryChangesW will still return true, but the entire contents of the buffer are discarded and the lpBytesReturned parameter will be zero, which indicates that your buffer was too small to hold all of the changes that occurred.
The buffer is too small for changes that need to monitor a large number of files.
from efsw.
The buffer size was limited because of an old Windows bug, at least that's what it says in the code:
efsw/src/efsw/WatcherWin32.hpp
Line 62 in b60a4e6
I can probably increase the buffer size.
I will take a look at this issue. Here are some remarks in the documentation:
https://docs.microsoft.com/en-gb/windows/win32/api/winbase/nf-winbase-readdirectorychangesw?redirectedfrom=MSDN#remarks
from efsw.
The buffer size was limited because of an old Windows bug, at least that's what it says in the code:
I can probably increase the buffer size.
Yes, what occupies this buffer is actually the string of the file path,so in the case of a large number of files or many long path files, 64k is too small.
from efsw.
In the current implementation, it seems impossible to determine whether the ReadDirectoryChangesW()
call has failed or not. Is it possible to provide users with information about any failures, so they can react accordingly?
Another suggestion could be to allow users to specify the buffer size or provide the buffer themselves, enabling them to tailor it to their needs. In this way, the onus is on the users to customize the buffer as necessary.
from efsw.
This issues has been fixes thanks to the @r00tcxx contribution in this PR. :)
from efsw.
Related Issues (20)
- Generic watcher fails to watch sub-sub directories HOT 6
- Filename passed without extension HOT 1
- Cannot track symlinked file in Linux HOT 10
- Bazel Building HOT 1
- On MacOS, actions happening shortly after starting watcher are not reported HOT 19
- CMake multi config issue HOT 2
- Support Windows long path aware HOT 4
- Check Return Code and Allow Buffer Customization in `ReadDirectoryChangesW()` Function HOT 1
- Paranoid exit code? HOT 2
- MacOS build on server HOT 1
- [Bug] Crash while thread running after FileWatcherInotfiy destructed. HOT 16
- Premake5 macosx after gmake2 ... [CI Server] HOT 1
- Last modified file remembered and failing to fire event under Windows HOT 5
- Premake links in ReadMe is dead HOT 1
- FSEventStreamScheduleWithRunLoop has been deprecated in MacOS 13 HOT 3
- Nested template syntax breaks LEGACY builds HOT 3
- Generic file watcher doesn't report new directories on network drives HOT 2
- memory leak doubt and thread conflict HOT 2
- Cross building on macOS may cause `EFSW_FSEVENTS_NOT_SUPPORTED` incorrectly defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from efsw.