0

Is there a way to implement a file on a FUSE filesystem such that to the kernel lookup procedure it appears as a symbolic link, but if a user program stats the file, it appears as a regular file? The point is to redirect particular calls to another filesystem such that the FUSE filesystem does not have to handle open, read, write and others acting on these files, yet, on the other hand, the redirection would be transparent to programs that would get confused by symbolic links. The result should be similar to bind mounts, but the FUSE filesystem can determine the targets as needed.

Juho Östman
  • 1,544
  • 1
  • 12
  • 20
  • Can't you just have the FUSE filesystem's `open()` implementation invoke `open()` on the target file? What more than that is really needed? – John Zwinck Nov 17 '13 at 11:15
  • It is inefficient to round-trip to userspace, especially if it is actually unnecessary. Also, my filesystem driver would not necessarily support every feature offered by the target, for example, the reflinks of btrfs. – Juho Östman Nov 17 '13 at 11:38
  • You already have it: stat()ing a link dereferences the link, you need lstat() to notice it's a symlink ;p – loreb Nov 17 '13 at 13:19

0 Answers0