FilmFS

A FUSE filesystem that tracks video file viewings and logs them to a SQLite database. I built it to learn more about SQLite as well as filesystems and how they interact with userspace applications.

Tech Stack

Category Technology Used
Language C, C++
Compiler GCC
Build System GNU Make, CMake
Libraries libFUSE, SQLite
Frameworks Qt (used for watchlistViewer)
Operating System Linux (POSIX adherence assumed)
License GNU General Public License V2

Features

Challenges & Solutions

I learned that media players often perform multiple read operations during a single viewing of a file. If each read were logged independently, the watch count would be incremented multiple times per viewing. To address this, I stored the PID of the last read operation in a static variable initialized to -1 (since valid PIDs are non-negative). New reads are only logged if the current PID is not the same as the last one.

Testing

Automated testing is planned for the next iteration, this document will be updated at that point.

Lessons Learned

While I already knew some basic SQL from a course I'd taken centered around Chuck Easttom's Network Defense And Countermeasures, this project taught me a lot about the basics of working with databases programmatically via SQLite.

This project deepened my knowledge of the POSIX filesystem API, but was not quite as challenging as I would have liked.

Future Plans

While FUSE abstracts much of the complexity of filesystem development, I plan to challenge myself by writing a kernel-level filesystem in the future to gain a more complete understanding of low-level I/O operations.

Further Reading

View Source Code on Github