The World Is a libferris Filesystem
Listing 1. A Long Listing of a Directory with Explicit Metadata
$ fls -l \ --show-ea=size-human-readable,width,height,name 4.5k 48 46 emacs.png 1.9k 48 48 gnome-warning.png 3.2k 48 48 gnome-xterm.png 2.5k 48 48 gtkvim.png
Listing 2. Asking libferris itself to determine which EAs are of interest for the current directory and producing an XML document as output.
$ fls -0 --xml <ferrisls> <ferrisls url="file:///tmp/lj" name="lj" > <context size-human-readable="4.5k" protection-ls="-rw-r-----" mtime-display="05 Dec 4 23:39" name="emacs.png" width="48" height="46" /> ... </ferrisls> </ferrisls>
As mentioned previously, if you are sorting a directory on an EA that does not provide a complete ordering, you can chain together sorting predicates. For example, in Listing 3, I have sorted the output based on the numeric EA height and then used a version string sort on the name EA. A version sort is similar to the ls(1) -v option, which in Listing 3 has placed foo20.png after foo3.png. Such sorting is very useful when sorting by file type or MIME major type followed by name.
Listing 3. Sorting Your Output
$ fls --show-ea=width,height,size,name \ --ferris-sort='(:#:height)(:V:name)' 48 48 1968 gnome-warning.png 48 48 3253 gnome-xterm.png 48 48 2550 gtkvim.png 48 46 4589 emacs.png 48 46 4589 foo3.png 48 46 4589 foo20.png
The two concepts of files forming a tree and files having key-value pairs attached to them are similar to the structure of XML. With libferris, you can poke inside XML documents as though they were just another filesystem. For example, see Listing 4.
Listing 4. Initial Exploration of XML as a Filesystem
$ cat example.xml <root> <file1 size="200" /> <file2 interesting="yes" /> <file3>filesystems rock </file3> </root> $ fls -0 ./example.xml/root file1 file2 file3 $ fls -d --show-ea=name,interesting \ ./example.xml/root/file2 file2 yes $ fcat example.xml/root/file3 filesystems rock
By interacting with your filesystem, you can cause updates on the underlying XML document as well. The ferris-redirect client exists to allow shell-like redirection into libferris files. The -T or --trunc option truncates an existing file before writing stdin into it. This is much like the >| shell option. As you can see from the interaction in Listing 5, we have changed the structure of the example.xml document significantly through filesystem interaction.
Listing 5. Changing an XML File through Its Filesystem
$ echo "VIRTUAL filesystems rock more" | \ ferris-redirect -T ./example.xml/root/file3 $ echo "a new way" | \ ferris-redirect ./example.xml/root/file4 $ ferrisrm ./example.xml/root/file2 $ ftouch ./example.xml/root/touched $ cat example.xml <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <root> <file1 size="200"/> <file3>VIRTUAL filesystems rock more </file3> <file4>a new way </file4> <touched/> </root>
As many modern word-processing documents are XML inside a compressed container, libferris allows you to drill down into the office document as though it were a filesystem. In Listing 6, I am listing a simple OpenOffice.org Writer document as a filesystem.
Listing 6. OpenOffice.org Documents Are Filesystems Too
$ fls -lh show-ea=size,name,content \ ~/sample-oo-writer.odt/content.xml/ \ office:document-content/office:body/office:text 0 office:forms 18 text:p Paragraph number 1 0 text:p-1 116 text:p-2 This is the second paragraph ... 0 text:p-3 39 text:p-4 And in summary, this is really... 0 text:p=5 0 text:sequence-decls
A Xerces-C Document Object Model (DOM) can be obtained for any libferris filesystem, just as a Xerces-C DOM can be mounted as a libferris filesystem. Creation of a DOM for a filesystem is evaluated lazily, so you can get a DOM for file:// and only the parts of the DOM that are required are ever created.
The ability to convert any libferris filesystem into a DOM allows you to apply XSLT to your filesystems easily. The example C++ code in Listing 7 applies a stylesheet to a mounted OpenOffice.org document.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




3 hours 48 min ago
14 hours 29 min ago
20 hours 15 min ago
20 hours 32 min ago
22 hours 25 min ago
1 day 19 min ago
1 day 7 hours ago
1 day 7 hours ago
1 day 9 hours ago
1 day 15 hours ago