If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
![]() |
|
|
#1 |
|
Tea maker
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,382
|
Just wondering if there are any *nix gurus here who could help with a tricky little problem (or perhaps point me at the right location).
I'd like to create (for want of a better term) a "synthesised" file, a bit like a named pipe/FIFO, except that when a program opens that file for reading, the system actually runs a program that generates the content 'on the fly'. (In a way it is also analogous to an executable script where the first line of the script tells how to interpret the remainder.) An example of what I'd like to achieve would be, say, decompressing a gzipped file transparently so that the reading program doesn't even know that the real source is compressed. Simply opening the file would automatically launch the decompression tool. (Unfortunately, reading from stdin and using a pipe seems to be out of the question). Has anyone seen this sort of thing before? TIA Simon
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay |
|
|
|
|
|
#3 |
|
Tea maker
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,382
|
Thanks. I'll take a look
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay |
|
|
|
|
|
#4 | |
|
Member
Join Date: Dec 2005
Posts: 639
|
Quote:
As for reading compressed files transparently, lots of applications already do that. You may want to take a look at the source code of these applications. |
|
|
|
|
|
|
#5 | ||
|
Tea maker
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,382
|
Quote:
Quote:
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay |
||
|
|
|
|
|
#6 | |
|
Member
Join Date: Dec 2005
Posts: 639
|
Quote:
I am not familiar with zlib, but it should surely be fairly straightforward to get a listing of the content of a compressed file and feed that back to your program for display to allow the user to select files of a subdirectory in the compressed file and so on. Since mc, Thunar etc. and other programs routinely do this, if you don't know how to do this, all you need to do is to look at the mc, Thunar code for an example of how to do it. Most GNU Linux utility programs and libraries have already been ported to Unix or vice versa or are trivial to port to Unix. As for faking file systems from user space without root access, it is obviously a serious security violation if anyone can do this - it opens the door to Windows 98 style security (or lack of it) and rampant cracker/virus/trojan vulnerability, so Unix/Linux systems sensibly don't permit this. On a properly administered Unix system, users can normally only mount file systems which are declared as user mountable in the /etc/fstab file, and all device files are only accessible to root. FUSE allows user space file systems, but you still need to compile the options into the kernel, which again for obvious security reasons requires root access. FUSE used in a properly administered Unix/Linux system would normally be used in a way that would not compromise the system security - eg. the user space filesystem programs would run under a non-root psuedo-user who no ordinary user can log in as - a kind of a second level administrator if you will. |
|
|
|
|
|
|
#7 |
|
Senior Member
|
Hi Simon,
Just wondering if you found a solution to your problem?
__________________
Regards. |
|
|
|
|
|
#8 |
|
Tea maker
Join Date: Feb 2002
Location: In the Island of Sodor, where the steam trains lie
Posts: 4,382
|
The sys admins just added N more terrabytes of storage!
__________________
"Your work is both good and original. Unfortunately the part that is good is not original and the part that is original is not good." -(attributed to) Samuel Johnson "I invented the term Object-Oriented, and I can tell you I did not have C++ in mind." Alan Kay |
|
|
|
|
|
#9 |
|
Senior Member
|
LoL, I guess that works too. I suppose considering the price of hardware it was probably not that much more expensive, if at all, than your time on the problem.
Thinking about it, without admin access, I don't imagine you'd want that to be possible, as you could easily hijack things that way.
__________________
Regards. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|