The World Is a libferris Filesystem
Listing 11. Output of One Virtual Console
$ fcreate --create-type=db4 --rdn=raw.db . $ fls --monitor-all -0 ./raw.db Created new1 Changed c:0x8321f88 /tmp/ljdb/raw.db Changed c:0x8321f88 /tmp/ljdb/raw.db Deleted new1 Created redirected-output Changed c:0x8321f88 /tmp/ljdb/raw.db
Listing 12. Output of Another Virtual Console
$ ftouch ./raw.db/new1 $ ferrisrm -v ./raw.db/new1 removing ./raw.db/new1 $ echo "hello" | \ ferris-redirect -T ./raw.db/redirected-output $ fcat ./raw.db/redirected-output hello
Many operations performed with libferris are also stored for possible future use. This includes the types of files you recently created (png, jpeg, db, tuple and so on), which files you recently edited and viewed and more. All of this is kept only for your personal use and never sent anywhere. Storage of metadata on files you view and edit is called remembrance in libferris. Only view and edit actions invoked through libferris are currently remembered. Listing 13 shows how I set up Xine to be executed as the default view operation on Annodex media files.
Listing 13. Setting Up Xine to Play Annodex Files
$ cat xine.desktop [Desktop Entry] Name=xine Comment=Video Player Exec=xine MimeType=video/mpeg;... Icon=~/icons/xine.png Terminal=0 Type=Application $ ferris-import-desktop-file xine.desktop $ ferris-set-file-action-for-type -v -a xine \ /tmp/Wombats.anx # Lets view the video. $ alias fv="ferris-file-action -v" $ fv /tmp/Wombats.anx
Now we can explore what libferris knows about our past operations. By default, remembered operations are grouped by operation type then media type. The recommended EA for the final directories in the tree are the filename and the time it was last viewed or edited. This history virtual filesystem shown in Listing 14 shows only a set amount of the most recent operations so as not to become too large.
Listing 14. Showing Recent View Operations
$ fls remembrance:// history $ fls remembrance://history edit view $ fls remembrance://history/view video $ fls -0h remembrance://history/view/video /tmp/Wombats.anx 05 Dec 6 21:34
For each file, you also can bring up the complete list of view and edit times. This uses what libferris calls a branch filesystem. A branch filesystem best can be described as an entire personal filesystem attached to a file. Branch filesystems are accessed using the branches:// handler; all other URL handlers appear as direct children of branches://.
In Listing 15, I take a look at what branches are available for my media file and explore the remembrance view filesystem. Then, out of curiosity, I take a look into the extents branch and see that the kernel's XFS filesystem has placed the whole media file in a single contiguous extent on disk.
To see if a file has a valid digital signature, you simply can read the has-valid-signature EA on the file. The signatures branch filesystem allows much more detail to be exposed about the signature. The branchfs-attributes filesystem exposes all EAs for a file as a filesystem. Sometimes it is more convenient to access an EA as though it is a file.
Listing 15. Branch Filesystems: a Filesystem about a File
$ fls branches://file/tmp/Wombats.anx branchfs-attributes branchfs-medallions branchfs-remembrance branchfs-extents branchfs-parents branchfs-signatures $ fls -0 branches://file/tmp/\ Wombats.anx/branchfs-remembrance/view 10.7M -rw-rw---- 05 Dec 6 21:34 ... 05 Dec 6 21:35 10.7M -rw-rw---- 05 Dec 6 21:34 ... 05 Dec 6 21:39 ... $ fls --xml \ branches://file/tmp/Wombats.anx/branchfs-extents <ferrisls> <ferrisls url="branches://.../branchfs-extents" name="branchfs-extents" > <context name="0" start-block="14245376" end-block="14267375" start-address="0" end-address="21999" /> </ferrisls> </ferrisls>
In the future, libferris will continue to support mounting more things and obtaining more metadata where it can. A module for FUSE is planned to supplement the current Samba support.
Resources for this article: /article/8947.
Ben Martin has been working on filesystems for more than ten years. He is currently working toward a PhD combining Semantic Filesystems with Formal Concept Analysis to improve human-filesystem interaction.
- Readers' Choice Awards 2013
- Advanced Hard Drive Caching Techniques
- Linux Kernel News - November 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- Raspberry Pi: the Perfect Home Server
- Sublime Text: One Editor to Rule Them All?
- RSS Feeds
- Linux Systems Administrator
- Web Administration Scripts
- animal pajamas
3 hours 22 min ago
- thanks for you post.
3 hours 29 min ago
- thanks for share, great
20 hours 43 min ago
- There are factors which are
1 day 1 hour ago
- Gnome 3 ?
1 day 2 hours ago
- Reply to comment | Linux Journal
1 day 6 hours ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 16 hours ago
- on the ground
1 day 23 hours ago
- I was able to read the whole
2 days 32 min ago
- since i have read the title i
2 days 3 hours ago