Skip to content

rintcius/go-suffuse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Suffuse client

A raw snapshot of generic file virtualization in progress. Written in go.

OS Status
Linux Build Status

Prerequisites

Go

OSX

brew install go

Linux

Get and extract the correct version (at least version 1.4.2) from The Go Download page

# Make sure to export GOROOT to the correct path
export GOROOT="$HOME/opt/go1.4.2"

GOPATH environment variable needs to be correctly set.

An example setup of the paths:

export GOPATH="$HOME/workspaces/go"
export PATH="$GOPATH/bin":$PATH

Installation

When you see ... it means literally three dots. It's the go syntax for "all projects under this directory."

go get -t github.com/suffuse/go-suffuse/cmd/suffuse

Suffuse has been installed in $GOPATH/bin.

A git checkout has been created in $GOPATH/src/github.com/suffuse/go-suffuse.

Running

The general steps for suffuse are:

  1. Mount using the suffuse command
  2. Interact with the mounted file system

Making sure suffuse is available

# Make the suffuse executable available on the path.
% export PATH=$PATH:$GOPATH/bin

# Run suffuse to get an overview of the options.
% suffuse
Usage: suffuse <options> [path path ...]

  -d=false: log at DEBUG level
  -m="": mount point
  -n="": volume name (OSX only)
  -t=false: create scratch directory as mount point
  -v=false: log at INFO level

Preparing a playground

# Create a directory to play in.
% mkdir -p ~/tmp/scratch

# Fill a file with digits 1 to 10.
% seq 1 10 > ~/tmp/scratch/seq.txt

Mounting

# Create a directory that holds the mount.
% mkdir ~/mnt

# Mount a directory through suffuse.
# The `&` runs suffuse in a separate process.
% suffuse -m ~/mnt ~/tmp/scratch &
[1] 9134

# List the contents through the suffuse mount.
% ls ~/mnt
seq.txt

Start playing

# It's a 10 line file, one number to a line.
% wc -l ~/mnt/seq.txt
10 /home/user/mnt/seq.txt

# Via suffuse, a derived file ending with #4,6p is a sed 
# command executed on the actual file.
% cat /mnt/seq.txt#4,6p
4
5
6

# Arbitrary sed commands, different sized files.
% ls -l /mnt/seq.txt#5,10p
-rw-r--r--  1 user  user  13 Jun 30 11:57 /mnt/seq.txt#5,10p

# These files are effectively indistinguishable from "real" files.
% ls -l /mnt/seq.txt#1,3p
-rw-r--r--  1 user  user  6 Jun 30 11:57 /mnt/seq.txt#1,3p

Kill the suffuse instance

% kill %1

Development

Make sure that:

  • your local checkout is located at: $GOPATH/src/github.com/suffuse/go-suffuse
  • the $GOROOT/bin directory is on your $PATH
# Continuous testing
bin/cc.sh
# Docker container works somewhat
bin/docker.sh

About

go client for suffuse

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.8%
  • Shell 3.9%
  • GAP 1.3%