Overlays
Featurepacks:
Foldie supports creating virtual folder overlays of directories and files from your file system. An overlay can be realized with a Virtual Folder Definition and via Default Overlays. The file browser supports to browse these overlays.
What is a folder-overlay?
Overlays are well-known from painting applications, such as Adobe Photoshop. There, an Overlay consists of a list of ordered layers, each of which contains an image with a transparent background. In the overall view, opaque pixels in the upper layers hide opaque pixels in the lower layer, that have the same coordinate.
For the sake of simplicity we assume that every layer L[i] in a folder-overlay is backed by a physical source folder F[i], that recursively contains items (files and folders) - the ‘pixels’. The coordinate of an item within a layer is given by its relative path from F[i]. Items with the same relative path but different source folders are stacked on top of each other in the order of their layers. The overall view on a folder-overlay is like an overlay file system.
Consequences
Facts:
- The root of an overlay is a virtual folder.
- An element of a virtual folder is a virtual file or again a virtual folder.
- A link into a virtual folder is a virtual file or virtual folder and generally refers to multiple physical items that share the same relative location.
Therefore, Foldie’s file browser
- has different modes to present the sources of an overlay,
- supports copying files from one layer of an overlay to another layer.
- supports creating the ‘same’ folder in a different layer.
One mode realizes an overlay file system.
What can you do with overlays?
In an overlay, you can
- stack a writable folder on top of a read-only folder,
- merge multiple information sources.
A writable folder on top of read-only folders enables you to
- add information that is only relevant to you next to of shared information,
- keep edited files next to original versions.
What are ‘read-only’ folders?
Here are some examples, in which you cannot write to a folder or should consider a folder to be non-writable:
- A shared folder which you cannot write to, such as an iCloud folder that a friend shares with you in read-only mode.
- A shared folder which you should not write to, for example because of company policies.
- A local copy of a resource folder. You should not write to it, because you would loose your changes the next time you install an updated version of the resource folder.
- A folder that you want to publish. You want to keep it clean of personal annotation files.
Technique: Writing over a read-only folder
If you have a read-only folder R and a writable folder W, you can stack W on top of R in an overlay O.
Virtually editing a file
If you take a file F with path P in R, edit and save it to the same path P in W, the edited version hides the unmodified version of F in O. This way you can virtually replace F without touching R. Foldie’s file browser supports copying F from R to W, so that you can edit that version with an external app afterwards.
Adding sibling files
For file F with path somepath/filename.ext in R, you can put an edited version at somepath/filename-version.ext or an annotation file at somepath/filename.txt. These files show up as sibling files next to F in the file browser.
Technique: Merging multiple sources
You can merge information not just from two folders, but from multiple sources. Assume you are working together with multiple colleagues on a shared folder R and every colleague C shares his overlay folder CW, then you can construct an overlay, in which all contributions are visible.
Sibling files with a naming convention including the colleage’s name are visible. Files from different sources with the same path can also be made visible by choosing a browsing mode that just merges directories but not files.
See also the tutor use cases.