aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/fuse.go
diff options
context:
space:
mode:
Diffstat (limited to 'swarm/api/fuse.go')
-rw-r--r--swarm/api/fuse.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/swarm/api/fuse.go b/swarm/api/fuse.go
index 4b1f817f8..2a1cc9bf1 100644
--- a/swarm/api/fuse.go
+++ b/swarm/api/fuse.go
@@ -14,7 +14,9 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
-// +build !windows
+// +build linux darwin freebsd
+
+// Data structures used for Fuse filesystem, serving directories and serving files to Fuse driver.
package api
@@ -29,10 +31,6 @@ import (
"golang.org/x/net/context"
)
-
-
-
-// Data structures used for Fuse filesystem, serving directories and serving files to Fuse driver
type FS struct {
root *Dir
}
@@ -55,7 +53,6 @@ type File struct {
reader storage.LazySectionReader
}
-
// Functions which satisfy the Fuse File System requests
func (filesystem *FS) Root() (fs.Node, error) {
return filesystem.root, nil
@@ -104,14 +101,12 @@ func (d *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error) {
}
func (file *File) Attr(ctx context.Context, a *fuse.Attr) error {
-
a.Inode = file.inode
//TODO: need to get permission as argument
a.Mode = 0500
a.Uid = uint32(os.Getuid())
a.Gid = uint32(os.Getegid())
-
reader := file.swarmApi.Retrieve(file.key)
quitC := make(chan bool)
size, err := reader.Size(quitC)
@@ -135,5 +130,4 @@ func (file *File) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.Re
}
resp.Data = buf[:n]
return err
-
}