This project implements a FUSE (Filesystem in Userspace) that provides on-the-fly file conversion between different formats. When accessing files through this file system, they are redirected to original folder, but in addition filesystem shows possible conversions as files with zero size. When they are accessed, in original folder conversion is created and you continue working with it.
- Transparent file format conversion when accessing files;
- Extensible architecture for adding new conversion types;
- Maintains original files while presenting converted views;
- Supports all standard file operations;
To mount the file system:
./on-the-fly_conversion -d /path/to/original/dir /path/to/mount/pointOr:
./on-the-fly_conversion --original-dir=/path/to/original/dir /path/to/mount/point-dor--original-diris required parameter and should be absolute path;/path/to/mount/pointis required fuse parameter;
To add new conversion types you need to implement a conversion function with the signature:
void convert_function(const char* from_file, const char* to_file);Register your conversion by adding it to the mappings array in main.cpp:
std::array mappings{
// other conversion mappings
conversion_mapping{ { "from", "to" }, convert_function };
};For example you can look at one of the implemented conversions:
- .txt to .md (
txt2md.h) - .png to .jpg (
png2jpg.handstb_conversions.cpp) - .jpg to .png (
jpg2png.handstb_conversions.cpp)