files-community / Files

A modern file manager that helps users organize their files and folders.
https://files.community
MIT License
34.56k stars 2.2k forks source link

Feature: Add 'compress' attribute to folder/file #15976

Open timofeika opened 3 months ago

timofeika commented 3 months ago

What feature or improvement do you think would benefit Files?

Tried to set extended attribute 'compressed' to big text file, and didn't find how to set this attribute. In properties of the file i can set only 'read only' and 'hidden'.

Requirements

Files Version

3.6.0.0

Windows Version

22635.4005

Comments

No response

0x5bfa commented 3 months ago

Thanks for the feedback.

Fyi this is an easy work; just call SetFileAttributesW using FILE_ATTRIBUTE_COMPRESSED flag, as we do similar for the hidden attribute.

timofeika commented 3 months ago

Sure, thinking to rewrite it to Rust, Kappa.

yaira2 commented 3 months ago

Thanks for the feedback

0x5bfa commented 3 months ago

Turned out that the dedicated function is DeviceIoControl with FSCTL_SET_COMPRESSION IOCTL control code. But still up-for-grabs.

yaira2 commented 2 months ago

Fyi this is an easy work; just call SetFileAttributesW using FILE_ATTRIBUTE_COMPRESSED flag, as we do similar for the hidden attribute.

@0x5bfa I've tried this but it doesn't seem to work. You can find my code in ya/CompressedAttribute.