jonywalker <jonywalker800-Re5JQEeQqe8AvxtiuMwx3w@...> writes:
> Hi all,
> I am writing user space fie system use fuse. I want to redirect any
> system call to a directory X into my file system calls. So i have
> implemented few file system calls (read, write, etc. . ). When i run my
> ./myfs /tmp/dirX
> Any call to /tmp/fuse will redirect to myfs. But when dirX is not empty i
> have to give -o nonempty option
> ./myfs /tmp/dirX -o nonempty.
> If i do so previous content in dirX will become inaccessible. What i wan to
> do is, i will mount my USB on to /tmp/dirX and i want to track every single
> call to that /tmp/dirX . Is it possible to achieve this using fuse?
> I am stuck please give me some idea to achieve this.
In your file system, open /tmp/dirX *before* calling fuse_mount and
store the directory handle. In your request handlers, use openat() et
al. with the stored directory handle.
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C