swarm/api: FUSE read-write support (#13872)

- Moved fuse related code in a new package, swarm/fuse
- Added write support
  - Create new files
  - Delete existing files
  - Append to files (with limitations)
- More test coverage
This commit is contained in:
Zahoor Mohamed
2017-04-12 05:36:02 +05:30
committed by Felix Lange
parent dd37064a15
commit 1d1d988aa7
15 changed files with 1693 additions and 362 deletions

View File

@ -68,7 +68,6 @@ func (self *FileSystem) Upload(lpath, index string) (string, error) {
log.Debug(fmt.Sprintf("uploading '%s'", localpath))
err = filepath.Walk(localpath, func(path string, info os.FileInfo, err error) error {
if (err == nil) && !info.IsDir() {
//fmt.Printf("lp %s path %s\n", localpath, path)
if len(path) <= start {
return fmt.Errorf("Path is too short")
}
@ -170,7 +169,7 @@ func (self *FileSystem) Upload(lpath, index string) (string, error) {
return hs, err2
}
// Download replicates the manifest path structure on the local filesystem
// Download replicates the manifest basePath structure on the local filesystem
// under localpath
//
// DEPRECATED: Use the HTTP API instead
@ -269,7 +268,7 @@ func (self *FileSystem) Download(bzzpath, localpath string) error {
}
func retrieveToFile(quitC chan bool, dpa *storage.DPA, key storage.Key, path string) error {
f, err := os.Create(path) // TODO: path separators
f, err := os.Create(path) // TODO: basePath separators
if err != nil {
return err
}