Note that there are some explanatory texts on larger screens.

plurals
  1. POfuse changes chown to?
    text
    copied!<p>i m trying to modify fuse <a href="http://fuse.sourceforge.net/helloworld.html" rel="nofollow">example</a> to mount any directory. I want to mount /home/nikhil in tmp. i ran it as, <code>$ ./ni /home/nikhil tmp</code></p> <p>It mounts tmp folder, but cannot access it.</p> <pre><code>$ls -ltr tmp </code></pre> <p><code>ls: cannot access tmp: Operation not permitted</code></p> <p><code>$ ls -ltr</code></p> <p><code>ls: cannot access delete: Operation not permitted total 11716 d????????? ? ? ? ? ? delete </code></p> <p>My code is</p> <pre><code>#define FUSE_USE_VERSION 26 #include &lt;fuse.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; #include &lt;errno.h&gt; #include &lt;fcntl.h&gt; #include &lt;stdlib.h&gt; #include &lt;limits.h&gt; #include &lt;unistd.h&gt; #define MAX 100 char *rootpath; static void ni_fullpath(char fpath[MAX], const char *path){ strcpy(fpath, rootpath); strncat(fpath, path, MAX); } static int ni_getattr(const char *path, struct stat *stbuf) { int res = 0; char fpath[MAX]; memset(stbuf, 0, sizeof(struct stat)); ni_fullpath(fpath, path); res = lstat(fpath, stbuf); return res; } static int ni_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) { (void) offset; (void) fi; // i didnt understand this filler(buf, ".", NULL, 0); filler(buf, "..", NULL, 0); ni_fullpath(fpath, path); filler(buf, fpath + 1, NULL, 0); return 0; } static int ni_open(const char *path, struct fuse_file_info *fi) { int fd; char fpath[MAX]; ni_fullpath(fpath, path); if ((fi-&gt;flags &amp; 3) != O_RDONLY) return -EACCES; fd = open(fpath, fi-&gt;flags); return fd; } static int ni_read(const char *path, char *buf, size_t size, off_t offset, struct fuse_file_info *fi) { return pread(fi-&gt;fh, buf, size, offset); } static struct fuse_operations ni_oper = { .getattr = ni_getattr, .readdir = ni_readdir, .open = ni_open, .read = ni_read, }; void ni_usage(){ fprintf(stderr, "usage ni rootDir mountPoint"); abort(); } int main(int argc, char *argv[]) { printf("%s %s \n", argv[1], argv[2]); rootpath = realpath(argv[1], NULL); argv[1] = argv[2]; argc--; return fuse_main(argc, argv, &amp;ni_oper, NULL); } </code></pre> <p>Can anybody help what i m doing wrong ? I m using ubuntu 1104 64 bit.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload