📜 ⬆️ ⬇️

Opening Boost.Filesystem

Today once again I felt like an idiot.

In the project that I am doing now, I needed to implement a small subroutine that would be engaged in monitoring a certain folder ( upload ) and in case of a new file there it would notify the remote system via RPC. (I directly implemented monitoring using inotify )

Since I love OOP and I don’t like procedural programming of opendir and readdir system calls, it seemed to me a little and I implemented a small set of classes for working with the file system according to all OOP canons: FSItem abstract class (with getName, getPath methods, with purely virtual methods isFile, isDir) from which the Directory (with the append method) and RegularFile are inherited. Although, rather, these classes do not serve to work with the file system, but more to store the structure of a directory in this model.
')
So ... All this is already implemented in the Boost.Filesystem .

Moral : it would be necessary to buy a book on boost , even in English (it seems there is no Russian). There is no time to read the full boost documentation at work. (But there is time to write to the blog ... Hmm.) And so before going to bed you can see a couple of pages and become smarter.

Source: https://habr.com/ru/post/55449/


All Articles