You can't do this in the same way as for /proc as the procfs filesystem doesn't really exist.
If you want to provide automated generation of a file's contents, then the easiest way to do this is probably using a named pipe (see the popen and pclose manpages) in a user-space program.
To do this with the kernel, you'll need to modify the driver of the filesystem that the file is on, so I wouldn't go down that route as it's likely to seriously mess up your system during development. Unless you want to create the file somewhere under /proc, in which case it's quite easy to do in a new module.
|