Original link:
http://www.eygle.com/unix/gmailfs-gmail.filesystem.config.htm
Google launched 1G Gmail, and then many mail providers began to provide 1G Gmail, Google once again leads the trend. After 1G Mail, how to use such a big storage space has become a problem :) Someone wrote Gmailfs, Gmail FileSystem --- Gmail file system.
You can find related content in the following link: http://richard.jones.name/google-hacks/gmail-filesystem/gmail-filesystem.html
I quote the description of Richard:
Gmailfs Provides a Mountable Linux FileSystem Which Uses Your Gmail Account As ITS Storage Medium. Gmailfs provides a loadable Linux file system, using Gmail account you can use Gmail as a storage medium.
GmailFS is a Python application and uses the FUSE userland filesystem infrastructure to help provide the filesystem, and libgmail to communicate with Gmail. GmailFS is the application of technology development using Python, using FUSE file system as the infrastructure, the use of libgmail Gmail and communications.
GmailFS supports most file operations such as read, write, open, close, stat, symlink, link, unlink, truncate and rename. This means that you can use all your favourite unix command line tools to operate on files stored on Gmail (eg cp , LS, MV, RM, LN, GREP ETC. ETC.).
Please be gentle on the code. This is my first foray into Python and I'm sure the code is far from elegant. I'm particularly concerned with my attempts to manipulate mutable byte arrays. I'm sure that there must be a less clumsy way of doing it than the nasty list -> array -> string path I'm currently using Python has a reputation as an excellent language choice for rapid prototyping.The first working version of GmailFS took about 2 days of coding There was.. An Additional 1.5 Days Spent on Performance Tuning and bugfixing. The first GmailFS version has taken approximately 2 days of time coding and then used for 1.5 days to perform performance adjustment and bug correction.
Given that this includes language learning curve, the reputation seems well deserved A special mention should go to libgmail and FUSE, both greatly contributed to the short development time and a bit concerned about Python:.. Guido van Rossum in 1990 it began developing Python, initially The purpose is nothing more than a self-entertainment project. As a fan of Monty Python, he gave him a weird name to this programming language. The meaning of Chinese meaning is big. Python was originally designed as a scripting language that replaces the AMOEBA distributed operating system ABC, but soon, this new programming language quickly developed into a weapon that can solve considerable problems, and now introduces a variety of platforms.
Think about it, foreign developers can often develop a powerful language and tools. Our country lacks such developers and such results. We are not lacking in programmers and smart people, we are lacking in pioneering genius.
In the case of the collateral, let's take a look at the installation and configuration of Gmailfs.
The current version of all software involved here can be downloaded from local.
1. Install Python 2.3 version
How To Install Python 2.3 on Linux
Then make a symbolic link:
[root @ Eygle bin] # ln -s /usr/bin/python2.3 / usr / bin / python
[root @ Eygle Bin] # ls -l python
LRWXRWXRWX 1 root root 18 Sep 24 23:35 python -> /usr/bin/python2.3
2. Install FUSE VERSION 1.3 can be downloaded in the following address: Fuse's Sourceforge Download Page
The installation steps are as follows:
# TAR ZXF FUSE-1.3.tar.gz
# CD FUSE-1.3
# ./configure
# Make
# make install
Installation Log Reference: Fuse Install Log
3. Install Python FUSE MODULE
The installation steps are as follows:
# TAR ZXF FUSE-PYTHON.TAR.GZ # cd fuse-python # python setup.py build # python setup.py install
The installation log is referred to as follows:
[root @ Eygle Soft] # CD FUSE-Python
[root @ eye fuse-python] # ls
Build code.leo cvs _fusemodule.c fuse.py install makefile readme setup.py xmp.py
[root @ Eygle Fuse-Python] # python setup.py build
Running build
Running build_py
Running build_ext
Building '_fusemodule' Extension
GCC -PTHREAD -FNO-STRICT-AliaSing -Dndebug -g-3 3 -wall -wstrict-prototypes -fpic -i / usr / include / python2.3 -c _fusemodule.c -o build / temp.linux-i686-2.3 / _fusemodule.o
GCC -PTHREAD -SHARED Build / Temp.Linux-i686-2.3 / _fusemodule.o -l ../ lib -lfuse -o build / lib.linux-i686-2.3 / _fusemodule.so
[root @ Eygle Fuse-Python] # python setup.py installrunning installer. INSTALL
Running build
Running build_py
Running build_ext
Running install_lib
Copying build / lib.linux-i686-2.3 / fuse.py -> /usr/lib/python2.3/site-packages
Copying build / lib.linux-i686-2.3 / _fusemodule.so -> /usr/lib/python2.3/site-packages
Byte-compling /usr/lib/python2.3/site-packages/fuse.py to fuse.pyc
4. Install Libgmail
Download here, note that the file format downloaded here is GZ, but it is actually a TGZ file.
The installation step is:
# TAR zxf libgmail-0.0.8.gz # cd libgmail-0.0.8 # cpibgmail.py constants.py /usr/lib/python2.3/site-packages
5. Install Gmailfs
Gmailfs can be downloaded here
The installation step is:
# TAR zxf gmailfs.tar.gz # cd gmailfs # cgmailfs.py / usr / local / bin # cp mount.gmailfs / sbin # ln -s /sbin/mount.gmailfs /sbin/mount.fuse
6. Start using the Gmailfs file system
You can use the following command MOUNT your gmailfs:
Mount -t gmailfs /usr/local/bin/gmailfs.py / mount_point -o username = gmailuser, password = gmailpass, sname = zolrra
Before use, you can modify the defaultusername in /usr/local/bin/gmailfs.py, so you can simplify the use of Gmailfs.
[root @ Eygle /] # mkdir gmail
[root @ Eygle /] # mount -t gmailfs /usr/local/bin/gmailfs.py / gmail -o fsname = EYGLE
[root @ Eygle /] # mount: Warning, Should Mount with username = GmailUser Option, Using Default
Mount: Warning, Should Mount with password = GmailPass Option, Using Default
[Root @ eygle /] # df -kFilesystem 1K-blocks Used Available Use% Mounted on / dev / sda1 5154852 3421812 1471184 70% // dev / sda7 101089 66140 29730 69% / home / dev / sda5 4127076 3347860 569572 86% / Optnone 515296 0 515296 0% / DEV / SHM / DEV / SDA2 4127108 2268464 1648996 58% / USR / DEV / SDA6 206350 1738360 1820324 8% / vargmailfs 1024000 17408 1006592 2% / gmail Next We can use Gmailfs:
[root @ Eygle /] # CD / home / gqgai / Soft
[root @ Eygle Soft] # ls -l
Total 10929
-rw-r - r - 1 root root 1480750 Sep 24 18:40 db4-4.1.25-14.i386.rpm
DRWXRWXRWX 8 1001 1001 1024 Sep 24 23:48 FUSE-1.3
-rw-r - r - 1 gqgai gqgai 563200 Sep 24 17:35 FUSE-1.3.TAR
DRWXR-XR-X 4 1002 1002 1024 Sep 24 19:06 FUSE-Python
-rw-r - r - 1 gqgai GQGAI 71680 Sep 24 17:35 fuse-python.tar
DRWXR-XR-X 2 1002 1002 1024 AUG 30 08:24 Gmailfs
-rw-r - r - 1 gqgai GQGAI 61440 Sep 24 17:35 gmailfs.tar
DRWXR-XR-X 3 root root 1024 Sep 25 00:14 Libgmail-0.0.8
-rw-r - r - 1 gqgai GQGAI 18803 Sep 24 19:37 libgmail-0.0.8.gz
-rw-r - r - 1 root root 7565683 jul 23 10:59 python2.3-2.3.4-3pydotorg.i386.rpm
-rw-r - r - 1 root root 678130 JUL 23 11:00 python2.3-devel-2.3.4-3pydotorg.i386.rpm
-rw-r - r - 1 root root 690451 JUL 23 11:00 python2.3-Tools-2.3.4-3pydotorg.i386.rpm
[root @ Eygle Soft] # cp libgmail-0.0.8.gz / gmail
[root @ Eygle Soft] # CD / GMAIL
[root @ eyegle gmail] # ls -l
Total 19
-rw-r - r - r (Root root 18803 Sep 25 00:32 Libgmail-0.0.8.gz
[root @ Eygle Gmail] # 7. Other
This issue is a wide range of discussion, refer to here.
Some people think that since someone can develop such a procedure in 2 days, it is naturally easy to connect more Gmail as a network storage. If Google thinks it is necessary to solve this problem, then all connections may be immediately Interrupt. Then this technique does not have stability and reliability.
Some people think that this is not a good thing for Google, they can have more data to analyze.
Some people have started from the actual point of view, and they do not have actual value due to the problem of the network.
These are not my concern, I want to say, this is the professional spirit we should learn.