The first feature added to Nautilus as part of my project is support for extracting compressed files. They can be extracted to the current directory or to any other location. The actions are available in the context menu:
Now you might be wondering, why add these to Nautilus if they look exactly the same as file-roller’s extension? Well, handling extraction internally comes with a few changes:
- improved progress feedback, integrated into the system used by the rest of the operations
- fine-grained control over the operation, including conflict situations which are now handled using Nautilus’ dialogs
- and probably, the most important change, extracting files in a way that avoids cluttering the user’s workspace. No matter what the archive’s contents are, they will always be placed in a single file or top-level folder – I’ll elaborate on that in a moment.
As I mentioned in my first post, the goal of this project is to simplify working with archives, and creating just one top-level item as a result of an extraction really reduces complexity. It is done in a pretty simple way:
- if the archive has a root element and they have the same base names (like image.zip which contains image.png or a folder named image/), the root element is extracted as it is
- if the root element has a different name or the archive has multiple elements, they are extracted in a folder having the same name as the archive, without its extension
As a result, the output will always have the name of the source archive, making it easy to find after an extraction. Also, the maximum number of conflicts an extraction can have is just one, the output itself. Hurray, no more need to go through a thousand dialogs!
If you have any suggestion or idea on how to improve this operation, feel free to drop a comment with it! Feedback is also much appreciated 🙂 See you in the next one!