Hacking Gmail

(Grace) #1

218 Part III — Conquering Gmail


How GmailFS Works


GmailFS works with four parts: FUSE, which provides the interface to the Linux
kernel that allows additional file systems to be created by programs (in what is
technically known as userspace); Libgmail, which provides the interface to Gmail;
Gmail, which provides the storage; and GmailFS itself, which links the three oth-
ers together.

The part of the system where FUSE talks with the Linux kernel is beyond the
scope of this book, and is well documented on the web. And by now you should
be confident with sending and receiving mail with Libgmail. So all you need to
understand is how the files are stored on Gmail.

What Makes Up a File?


To really understand the system, you need to know how a general UNIX file sys-
tem identifies a file. Under an ordinary Unix file system, a file consists of three
things: the content of the file itself; a file called an inode, which contains the
details of the file; and a pointer to the inode inside another file that represents a
directory.

This is perhaps a little confusing, so consider an example. Say you want to access a
file called supersecretpasswords.txt. To display the contents of the file you
would ordinarily use the command cat supersecretpasswords.txt. You can
see this in Figure 16-2.

FIGURE16-2: Displaying the contents of a file
Free download pdf