Name: Anonymous 2006-05-26 4:22
We have symbolic links in most OSes, which are a small file which points to another file which is evaluated as it's accessed.
Why not having some kind of "view" attribute for files which make the OS to execute the file through the usual means (executable code or script specifying the scripting host with #! in the first line), then make it as if the results of this command are the contents of the file? (This view would be read-only, of course.)
When a process open()s or CreateFile()s a view, the OS executes the command and passes the process the results (lazily evaluated, keeping the command running unless it reaches EOF). If another process concurrently opens the file, the command is executed again in case the results could change, but they should be kept consistent for every handle (in a memory buffer, to allow for backwards random access).
To edit the view, one would just unset the view attribute and edit it as a regular file, then set it to view again.
I think this would be a good feature to have in case some files are the result of something else being calculated when you read the file. I just needed this.
Why not having some kind of "view" attribute for files which make the OS to execute the file through the usual means (executable code or script specifying the scripting host with #! in the first line), then make it as if the results of this command are the contents of the file? (This view would be read-only, of course.)
When a process open()s or CreateFile()s a view, the OS executes the command and passes the process the results (lazily evaluated, keeping the command running unless it reaches EOF). If another process concurrently opens the file, the command is executed again in case the results could change, but they should be kept consistent for every handle (in a memory buffer, to allow for backwards random access).
To edit the view, one would just unset the view attribute and edit it as a regular file, then set it to view again.
I think this would be a good feature to have in case some files are the result of something else being calculated when you read the file. I just needed this.