title: FUSE error: Transport endpoint is not connected
body: <p>I'm trying to implement the FUSE filesystem.  I am receiving this error:</p>
  
  <blockquote>
    <p>cannot access MountDir: Transport endpoint is not connected</p>
  </blockquote>
  
  <p>This the relevant parts of the program. There are two directories, <code>MirrorDir</code> and <code>MountDir</code>, that exist withing the same directory as all of the code. I am calling the program like this:</p>
  
  <pre><code>./myFS -o nonempty -o allow_other MirrorDir MountDir
  </code></pre>
  
  <p>Can anyone see what I am doing wrong?</p>
  
  <pre><code>static struct fuse_operations xmp_oper = {
      .getattr    = xmp_getattr,
      .readdir    = xmp_readdir,
      .open       = xmp_open,
      .read       = xmp_read,
  };
  
  int main(int argc, char *argv[]) {
      int fuse_stat;
      char* mirrorDir;
  
      mirrorDir = malloc(sizeof(strlen(argv[argc-2]+1)));
      if (mirrorDir == NULL) {
          perror("main calloc");
          abort();
      }
  
      // Pull the rootdir out of the argument list and save it in my internal data
      mirrorDir = realpath(argv[argc-2], NULL);
  
      argv[argc-2] = argv[argc-1];
      argv[argc-1] = NULL;
      argc--;
  
      // turn over control to fuse
      fprintf(stderr, "about to call fuse_main\n");   
      fuse_stat = fuse_main(argc, argv, &amp;xmp_oper, mirrorDir);
      fprintf(stderr, "fuse_main returned %d\n", fuse_stat);
      return fuse_stat;
  }
  </code></pre>