Giter Club home page Giter Club logo

Comments (8)

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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.

SpartanJ avatar SpartanJ commented on September 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.