Comments (2)
off the bat, I suspect because you are not filling *Attr in the call.
You are setting Debug, but nothing gets printed. Are you sure stderr is not
redirected?
On Wed, May 28, 2014 at 9:49 AM, fbenkstein [email protected]:
Hi,
I am trying to dynamically create filenames when they are being accessed
but it seems something isn't working. I do not know whether it is a bug in
my program or no.Here's my example program:
package main
import (
"flag"
"fmt"
"log"
"os"
"path""github.com/hanwen/go-fuse/fuse" "github.com/hanwen/go-fuse/fuse/nodefs")
type testNode struct {
nodefs.Node}
func newTestNode() nodefs.Node {
node := testNode{nodefs.NewDefaultNode()}
return &node}
func (r _testNode) Lookup(out *fuse.Attr, name string, context *fuse.Context) (_nodefs.Inode, fuse.Status) {
node := r.Inode().NewChild(name, false, newTestNode())
return node, fuse.OK}
func main() {
flag.Parse()if flag.NArg() < 1 { fmt.Printf("usage: %s MOUNTPOINT\n", path.Base(os.Args[0])) os.Exit(2) } mountPoint := flag.Arg(0) root := newTestNode() server, _, err := nodefs.MountRoot(mountPoint, root, &nodefs.Options{ EntryTimeout: 0, NegativeTimeout: 0, AttrTimeout: 0, PortableInodes: true, }) server.SetDebug(true) if err != nil { log.Fatalf("Failed to mount filesystem: %v", err) } server.Serve()}
On the shell I get the following results:
$ go run test.go /tmp/test
$ stat /tmp/test/abc
stat: cannot stat/tmp/test/abc': Input/output error $ stat /tmp/test/abc File:
/tmp/test/abc'
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 1ah/26d Inode: 3 Links: 0
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 1970-01-01 01:00:00.000000000 +0100
Modify: 1970-01-01 01:00:00.000000000 +0100
Change: 1970-01-01 01:00:00.000000000 +0100
Birth: -Why does the first call fail and second one succeed?
Best regards,
Frank.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/23
.
Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen
from go-fuse.
Hi,
you were absolutely right about *Attr. After setting Mode to something reasonable the error disappears. The reason the debug output was missing was that I switched debug off to generate the output above.
Thank you for your help!
Regards,
Frank.
from go-fuse.
Related Issues (20)
- opcode POLL HOT 8
- panic: LARGEFILE (8000) overlaps with LARGEFILE (8000) HOT 2
- Loopback fs could no be used inside a tree HOT 1
- Race in Inode.Forgotten() HOT 8
- Error message when using `DirectMount: true`: writer: Write/Writev failed, err: 2=no such file or directory. opcode: RELEASE HOT 4
- Concurrent mount/unmount results in hanging HOT 15
- Support for linux FUSE_SETXATTR_EXT HOT 1
- FUSE Passthrough Support HOT 1
- Support for fuse_custom_io feature HOT 2
- Implementing Loopback FS - memory access error in path() function HOT 3
- Issues when unmounting on linux/ darwin HOT 15
- Changing filesize in Getattr Loopback HOT 2
- conflicting values on mipsel64 HOT 4
- macFUSE + LoopbackFS copying files through Finder not working HOT 7
- darwin: go-fuse/fuse.CAP_RENAME_SWAP has value 1<<25 while VFS_RENAME_SWAP has value 0x00000002
- how to use go-fuse HOT 10
- Get PID of requesting process HOT 1
- Feature request: Server.Stop in order to allow resuming in a new process HOT 3
- How to disable RENAME_SWAP HOT 1
- How to exit go-fuse process gracefully? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fuse.