Comments (8)
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
What's the difference?
You are getting all the events for file modifications. Just do something like: if ( !IsDirectory( filepath ) ) { doWhatEver(); }.
This should not be resolved by the library, but by the user.
The library is only intended for only one thing: monitor the file system. The rest can be done by the user.
I want to keep the library as simple as possible, i don't want to resolve everyone's issues.
Also: you can use some of the helpers used by the library to achieve this, like FileInfo class.
from efsw.
Original comment by Yash pal (Bitbucket: codeyash, GitHub: codeyash).
I mean why this is added.
if ( !fi.isDirectory() )
{
return Errors::Log::createLastError( Errors::FileNotFound, dir );
}
If I remove this condition what would happen.
I guess these are basic questions will be asked whenever some will try to use library. Its upto you reacting on such issues.
My only aim making library usable in normal case scenarios. Ofcourse only simple ones.
One more things you know each every thing about monitoring so things looks very simple at your end and may be complex for others. :)
Please guide me a bit
from efsw.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
I mean why this is added. if ( !fi.isDirectory() ) { return Errors::Log::createLastError( Errors::FileNotFound, dir ); }
Because it would not work at all.
The OS functionality that i'm using is prepared to watch directories, not files, this is not a whim from my part, it's just how it works. Also you can still achieve this really easily.
Please look at other implementations of file system watchers, all of them watch directories, that's the very definition of a file system watcher ( examples: Qt FSW, .NET FSW ).
I guess these are basic questions will be asked whenever some will try to use library. Its upto you reacting on such issues. My only aim making library usable in normal case scenarios. Ofcourse only simple ones.
Sorry, but i don't agree. The header file is documented plus the README file, and they are really clear in how it works the library.
The library is totally usable for what you wan't to achieve. I can add another class to filter things, as an example, it shouldn't take longer than 100 lines of code. The class should inherit FileWatchListener and take control of the handleFileAction, to pass a filter over that, and just call to an another virtual method, something like handleFileActionFiltered.
If you are completely lost about how to achieve this and can wait until the weekend, i can add this.
One more things you know each every thing about monitoring so things looks very simple at your end and may be complex for others. :)
It's possible. But to add complexity to the library i need really good reasons.
from efsw.
Original comment by Yash pal (Bitbucket: codeyash, GitHub: codeyash).
ok I got all your points.
My problem (personal may be)
I'm watching one folder for changes.
File outside that folder changed or may totally different location . I need to monitor that file( one or more) and not whole dir tree outside.
How to achieve this.
That's it.
If possible whenever you are free please provide a example.
from efsw.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Why don't you watch the directory non-recursively? ( addWatch third parameter set to false, and default behavior ).
File outside that folder changed or may totally different location .
I don't understand what you're trying to say. I suppose you're trying to say that you need to know where the file is moved in the case that a file is moved outside of the directory tree you're monitoring. There's no real solution for that ( well, there's always a solution for almost everything, but not you'll need to do some low-level stuff and per-os implementation ).
Anyway, this is not a bug. I'll close the issue.
Don't open issues to ask questions, just send me a private message.
Regards
from efsw.
Original comment by Yash pal (Bitbucket: codeyash, GitHub: codeyash).
I got idea like reverse of ignore file we can accept change in directory for specific files
acceptOnlyList if acceptOnly is true
I think I can implement this one, I tried n found file implementation work seems out of scope (too much time)
if you like idea let me know..I will post in separate request else np
:)
from efsw.
Original comment by Martín Lucas Golini (Bitbucket: SpartanJ, GitHub: SpartanJ).
Well, this is what i said here. It can be implemented in many ways,and that's exactly why i don't want to add it in the library. What you're trying to achieve can be implemented in less than 20 lines of code, that i don't see the point to add it as part of the library, since it's really trivial. Anyway, may be i'll add it as a complementary class, as i said here.
Regards!
from efsw.
Original comment by Yash pal (Bitbucket: codeyash, GitHub: codeyash).
Yes its personal but may help someone also
Can you help in creating this complementary class ( with ignore and accept only)
Is there any difference in watching a file and folder in terms of FD ( I mean resource consumption) ?
-Yash
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
- Incorrect move events reported for simultaneous file moves across monitored subdirectories on Windows HOT 9
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.