24.07.2017 Views

Hacking Gmail

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

218 Part III — Conquering <strong>Gmail</strong><br />

How <strong>Gmail</strong>FS Works<br />

<strong>Gmail</strong>FS works with four parts: FUSE, which provides the interface to the Linux<br />

kernel that allows additional file systems to be created by programs (in what is<br />

technically known as userspace); Libgmail, which provides the interface to <strong>Gmail</strong>;<br />

<strong>Gmail</strong>, which provides the storage; and <strong>Gmail</strong>FS itself, which links the three others<br />

together.<br />

The part of the system where FUSE talks with the Linux kernel is beyond the<br />

scope of this book, and is well documented on the web. And by now you should<br />

be confident with sending and receiving mail with Libgmail. So all you need to<br />

understand is how the files are stored on <strong>Gmail</strong>.<br />

What Makes Up a File?<br />

To really understand the system, you need to know how a general UNIX file system<br />

identifies a file. Under an ordinary Unix file system, a file consists of three<br />

things: the content of the file itself; a file called an inode, which contains the<br />

details of the file; and a pointer to the inode inside another file that represents a<br />

directory.<br />

This is perhaps a little confusing, so consider an example. Say you want to access a<br />

file called supersecretpasswords.txt. To display the contents of the file you<br />

would ordinarily use the command cat supersecretpasswords.txt. You can<br />

see this in Figure 16-2.<br />

FIGURE 16-2: Displaying the contents of a file

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!