Changes between Initial Version and Version 1 of pyFilesystem


Ignore:
Timestamp:
2011-10-25T06:08:07Z (12 years ago)
Author:
ClashTheBunny
Comment:

Quick write up of using pyFilesystem with Tahoe-LAFS

Legend:

Unmodified
Added
Removed
Modified
  • pyFilesystem

    v1 v1  
     1Tahoe-LAFS works with pyFilesystem.  It is not officially maintained by Tahoe-LAFS devs, but it works.
     2
     3Here is the email that this is based off of:
     4http://tahoe-lafs.org/pipermail/tahoe-dev/2011-August/006663.html
     5
     61. Get and install Dokan lib at http://dokan-dev.net/en/download/#dokan
     7
     82. Get pyfilesystem at http://code.google.com/p/pyfilesystem/downloads/list or do a `pip install fs` and skip to step 4.
     9
     103. Install pyfilesystem:
     11{{{
     12cmd> python setup.py build
     13cmd> python setup.py install
     14}}}
     15
     164. Verify that pyfilesystem is installed:
     17{{{
     18cmd> python
     19python>>> import fs
     20python>>> fs.__version__
     21}}}
     225. Mount test/public grid to F:\ letter
     23{{{
     24cmd> python
     25python>>> from fs.contrib.tahoelafs import TahoeLAFS
     26python>>> from fs.expose import dokan
     27python>>> fs = TahoeLAFS('URI:DIR2:ctmtx2awdo4xt77x5xxaz6nyxm:n5t546ddvd6xlv4v6se6sjympbdbvo7orwizuzl42urm73sxazqa')
     28python>>> mp = dokan.mount(fs, "f", foreground=True)
     29}}}
     30
     31This works fine.  I have a slightly different setup since this also works with FUSE.
     32
     33On Windows, follow the above steps up to and including step 4.
     34
     35On Linux, do a `pip install fs` and make sure fuse is installed.
     36
     37Then you can edit this script:
     38{{{
     39#!/usr/bin/env python
     40
     41URI='URI:DIR2:ctmtx2awdo4xt77x5xxaz6nyxm:n5t546ddvd6xlv4v6se6sjympbdbvo7orwizuzl42urm73sxazqa'
     42
     43import time
     44from fs.contrib.tahoelafs import TahoeLAFS
     45
     46try:
     47        from fs.expose import dokan
     48        fs = TahoeLAFS(URI)
     49        mp = dokan.mount(fs, "f")
     50
     51except:
     52        from fs.expose import fuse
     53        fs = TahoeLAFS(URI)
     54        mp = fuse.mount(fs, "/mnt/tahoe")
     55}}}
     56
     57Replace URI with your URI on your grid.  The above URI is the test writable URI in the TestGrid.  Replace the "f" in
     58`mp = dokan.mount(fs, "f")` with the Windows drive letter you want to use or replace the "/mnt/tahoe" in `mp = fuse.mount(fs, "/mnt/tahoe")` with the fuse mount point on, I think, all other systems.
     59
     60Run the script and it will mount the URI at the specified location.  If you want to unmount it, find out where dokanctl.exe is and run it from the command line `dokanctl.exe /u f:`.  Sometimes I have to force the unmount on Windows. Use `fusermount -u /mnt/tahoe` on the FUSE systems.