Opening Boost.Filesystem

    Today once again I felt like an idiot.

    In the project that I am currently working on, I needed to implement a small subroutine that would monitor a specific folder ( upload ) and, if a new file appears there, notify the remote system about it via RPC. (I implemented monitoring directly using inotify )

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

    So ... All this is already implemented in Boost.Filesystem .

    Moral : you should buy a book on boost, even in English (in Russian, it seems, no). True, there is no time to read the full documentation on boost at work. (But there’s time to write a blog ... Hmm.) And before bedtime you can view a couple of pages and I’ll become smarter.

    Also popular now: