title: Custom fs with libfuse and file ownership
body: <p>When user create file, create callback will be called:</p>
  
  <pre><code>int (*create) (const char *, mode_t, struct fuse_file_info *);
  </code></pre>
  
  <p>see link for details <a href="https://github.com/libfuse/libfuse/blob/74596e2929c9b9b065f90d04ab7a2232652c64c4/include/fuse.h#L609" rel="nofollow noreferrer">https://github.com/libfuse/libfuse/blob/74596e2929c9b9b065f90d04ab7a2232652c64c4/include/fuse.h#L609</a></p>
  
  <p>But where are no info about what user want to create a file, means file will be always created with owner user that fuse process run from.</p>
  
  <p>For example I started fuse process as a root, but create file from my user:</p>
  
  <pre><code>$ echo $USERNAME
   myuser
  $ echo 'f' &gt; f
  $ ll
  $ ll
  total 4,0K
  -rw-r--r-- 1 root root
  </code></pre>