Thread overview
Can i watch folders/files for changes with D language?
Oct 09, 2018
Ephrahim
Oct 09, 2018
Vladimir Panteleev
Oct 11, 2018
Ephrahim
Oct 09, 2018
Daniel Kozak
Oct 10, 2018
Russel Winder
Oct 10, 2018
Jacob Carlborg
October 09, 2018
Hi Everyone, i'm planning on developing a software for synchronizing folder contents across multiple computers. The software will evolve very quickly into virtual Remote Desktop Access system.
So i've been considering C++ for this, its the best in the market of all things fast at the moment (Considering the availability of tools and docs). But i hate just two things in the language, (.cpp + .h files) and no "easy" centralized package manager.
So i'm definitely considering D and Python now, but D seems to satisfy my needs as per this software. I've developed very good custom server for hardware before, and it performed very well.
So i need your help guys, can you point me to any documentation or libraries i can use to watch files/folders for changes (delete, edit, new content)?
I intend to make this a command line tool for a start, but i'll need a GUI sooner or later. So i also need help pointing me to the best available GUI library D has.

Your help will be so valuable and really appreciated sir/ma. I'll be waiting excitedly for your responses!

Also i'm very sorry if i didn't post this to the right Thread/Forum, i just found this forum and i wasn't very sure where i'd post this. Thanks a lot
October 09, 2018
On Tuesday, 9 October 2018 at 17:20:25 UTC, Ephrahim wrote:
> So i need your help guys, can you point me to any documentation or libraries i can use to watch files/folders for changes (delete, edit, new content)?

This package seems to do what you need:
https://code.dlang.org/packages/fswatch

> Also i'm very sorry if i didn't post this to the right Thread/Forum, i just found this forum and i wasn't very sure where i'd post this. Thanks a lot

You posted this in the right forum :)

October 09, 2018
You can use vibed:
http://vibed.org/api/vibe.core.file/DirectoryWatcher
Or just vibe-core
https://code.dlang.org/packages/vibe-core
Or
https://code.dlang.org/packages/eventcore

As a bonus you can use it for networking too.

About GUI I do not know what is the best solution. I have some experience with GTKD, which works well for me.



On Tue, Oct 9, 2018 at 7:25 PM Ephrahim via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote:

> Hi Everyone, i'm planning on developing a software for
> synchronizing folder contents across multiple computers. The
> software will evolve very quickly into virtual Remote Desktop
> Access system.
> So i've been considering C++ for this, its the best in the market
> of all things fast at the moment (Considering the availability of
> tools and docs). But i hate just two things in the language,
> (.cpp + .h files) and no "easy" centralized package manager.
> So i'm definitely considering D and Python now, but D seems to
> satisfy my needs as per this software. I've developed very good
> custom server for hardware before, and it performed very well.
> So i need your help guys, can you point me to any documentation
> or libraries i can use to watch files/folders for changes
> (delete, edit, new content)?
> I intend to make this a command line tool for a start, but i'll
> need a GUI sooner or later. So i also need help pointing me to
> the best available GUI library D has.
>
> Your help will be so valuable and really appreciated sir/ma. I'll be waiting excitedly for your responses!
>
> Also i'm very sorry if i didn't post this to the right Thread/Forum, i just found this forum and i wasn't very sure where i'd post this. Thanks a lot
>


October 10, 2018
On Tue, 2018-10-09 at 17:20 +0000, Ephrahim via Digitalmars-d-learn wrote:
> Hi Everyone, i'm planning on developing a software for
> synchronizing folder contents across multiple computers. The
> software will evolve very quickly into virtual Remote Desktop
> Access system.
> So i've been considering C++ for this, its the best in the market
> of all things fast at the moment (Considering the availability of
> tools and docs). But i hate just two things in the language,
> (.cpp + .h files) and no "easy" centralized package manager.
> So i'm definitely considering D and Python now, but D seems to
> satisfy my needs as per this software. I've developed very good
> custom server for hardware before, and it performed very well.
> So i need your help guys, can you point me to any documentation
> or libraries i can use to watch files/folders for changes
> (delete, edit, new content)?

Conan is the up and coming centralised package management system for C++.

C++ may, or may not, get modules (and so remove the .cpp/.h split) sometime before the heat death of the universe.

You should add Rust to the list of options I believe.

Not sure whether Go should be added as well, probably Yes.

Python, D, Rust, and Go, all have bindings the the various file
watching facilities in the various operating systems.

> I intend to make this a command line tool for a start, but i'll need a GUI sooner or later. So i also need help pointing me to the best available GUI library D has.

It is really a question of which GUI framework you want to use. This is a situation where a bit of forward planning will help avoid having to reimplement or hack in silly ways.

The two obvious candidates are Qt and GTK if you want to be cross- platform. This then leads to the question which programming languages have good bindings to the frameworks. I am more or less in the GTK camp now having more or less given up on Qt, however Qt remains a very good choice.

D, Python, and Rust have excellent bindings to GTK. Go has a good binding. C++ binding to GTK is not bad, but I prefer the D and Rust ones.

Python has an excellent binding to Qt (use PySide2). Obviously C++ has an excellent binding to Qt since Qt is a C++ library. I have not properly investigated D and Rust bindings to Qt. The Big Question™ is whether to use QML or not. I get the feeling the answer is yes you probably should. The Python and Go binding for using QML are good, I haven't tried D, Rust, or C++.

[…]

-- 
Russel.
===========================================
Dr Russel Winder      t: +44 20 7585 2200
41 Buckmaster Road    m: +44 7770 465 077
London SW11 1EN, UK   w: www.russel.org.uk



October 10, 2018
On 2018-10-09 19:20, Ephrahim wrote:

> I intend to make this a command line tool for a start, but i'll need a GUI sooner or later. So i also need help pointing me to the best available GUI library D has.

It's difficult to specifying a single best GUI library. But I'll mention DWT [1] [2]. It has a native look and feel and works on Windows and Linux (GTK).

[1] http://code.dlang.org/packages/dwt
[2] https://github.com/d-widget-toolkit/dwt

-- 
/Jacob Carlborg
October 11, 2018
On Tuesday, 9 October 2018 at 17:38:44 UTC, Vladimir Panteleev wrote:
> On Tuesday, 9 October 2018 at 17:20:25 UTC, Ephrahim wrote:
>> So i need your help guys, can you point me to any documentation or libraries i can use to watch files/folders for changes (delete, edit, new content)?
>
> This package seems to do what you need:
> https://code.dlang.org/packages/fswatch
>
>> Also i'm very sorry if i didn't post this to the right Thread/Forum, i just found this forum and i wasn't very sure where i'd post this. Thanks a lot
>
> You posted this in the right forum :)

Thanks Everyone, you guys are simply the best! I got much more than i asked for, thanks a lot guys. With this awesome community support, i'm definitely shooting for D + python(UI)