1

I wanted to know if I can make a symlink to a file say in a Database.

This is a wild guess, but is it possible to intercept the link-follow say using a C function and then let function return the file say in a stream.

Cygwin does similar intercept for symlink follow, when we require symlinks in windows right, by reading a .lnk and another associate file for the rest of the dat which is supposed to be in a symlink and then do the follow.

My real scenario: I wanted to see if I can get a symlink to follow a file to a HDFS file which I can say pull using its API.

Iceman
  • 121

1 Answers1

4

There are at least 2 mechanisms readily available in Linux (but probably not in cygwin). There is the fuse filesystem, see man fuse, which allows you to implement a filesystem in user-space. For example, curlftpfs (see its man page) converts file accesses into curl ftp calls.

Then there is the fanotify system call, which allows you to intercept calls made to open or read a file, and substitute or manipulate the data. See man fanotify.

meuh
  • 51,383