[Interest] QFile subclass that does HFS compression?
annulen at yandex.ru
Mon Dec 17 20:35:23 CET 2018
17.12.2018, 22:28, "René J. V. Bertin" <rjvbertin at gmail.com>:
> Thiago Macieira wrote:
>> How does that work? Is that just an ioctl, fcntl or a similar system call on
>> the open file descriptor? If so, you can do it right now.
> Unfortunately, no. Decompression is transparent like you'd expect from a
> filesystem level for of compression, but you have to do the compression
> yourself. And it's a chunked form of compression, but that probably makes it
> easier to integrate it into an existing "write pipe" where you do not already
> have all data ready to be written to storage.
> You also have to maintain a chunk offset table, and a bit of metadata like the
> uncompressed file size. Depending on the size of the compressed data, it's
> stored either as an extended attribute, or else it goes into the file's resource
> Libarchive has an option to extract the files with HFS compression, if you want
> to have a look at a well-tested implementation.
>> Do you want an API for it?
> No, I was thinking of an option to set while opening a file for writing and that
> makes the compression as transparent as possible (seek would probably have to be
> disabled for instance).
>> could benefit from this, the proposal would be stronger. NTFS and btrfs have
>> compression, for example, and on Linux you can set attributes like secure
>> deletion too.
> I don't know about secure deletion but the compression in NTFS and btrfs (or
> ZFS) is not a property you request when you open a file AFAIK.
I'm not sure about ZFS, but other mentioned file systems support per-file compression
setting. In Linux this is done by setting FS_COMPR_FL flag in FS_IOC_GETFLAGS ioctl
> It's a filesystem
> property that is set at the level of the directory or dataset. HFS compression
> in QFile would really be Mac-specific, most 3rd-party HFS drivers for other OSes
> do not even support the feature.
> Interest mailing list
> Interest at qt-project.org
More information about the Interest