floren / go9p

Automatically exported from code.google.com/p/go9p
Other
1 stars 0 forks source link

no way to construct a File from a Fid #31

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
if you get a Fid from say, clnt.Auth, it is practically useless. i would like 
to pass the auth fid to factotum, but my factotum library needs a io.ReadWriter 
to speak to the server. you can't simply construct a File from a Fid, which 
would meet the io.ReadWriter interface.

Original issue reported on code.google.com by mischief@offblast.org on 25 Aug 2014 at 10:58

GoogleCodeExporter commented 9 years ago
I don't have time to look into this, but I would gladly accept a patch.

Thanks.

Original comment by lion...@gmail.com on 26 Aug 2014 at 7:01

GoogleCodeExporter commented 9 years ago
patch follows.
==============

diff -r 630c71178faf p/clnt/clnt.go
--- a/p/clnt/clnt.go    Wed May 14 13:19:14 2014 -0600
+++ b/p/clnt/clnt.go    Sat Aug 30 06:25:33 2014 +0000
@@ -74,6 +74,10 @@
        offset uint64
 }

+func NewFile(f *Fid, offset uint64) *File {
+    return &File{f, offset}
+}
+
 type pool struct {
        sync.Mutex
        need  int

Original comment by mischief@offblast.org on 30 Aug 2014 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by lion...@gmail.com on 5 Dec 2014 at 6:10