Re: (reiserfs) Re: I discussed reading directories as files with jra, Stallman, and

Jeff Epler (jepler@inetnebr.com)
Tue, 22 Jun 1999 20:59:54 -0500


On Tue, Jun 22, 1999 at 07:49:01PM -0400, Albert D. Cahalan wrote:
> You might wonder what older software will do when it encounters such
> a file. Anything using the proper API is handled by the DLL, but that
> leaves general tools like GNU tar. The NT kernel takes care of the
> remaining problems, using reparse point drivers to create an old-format
> file as needed.
>
> No joke. We'd do this with loadable modules, much like masquerading
> has drivers for all the odd network protocols.

You're going to put application data file formats in the kernel?

YOU'RE GOING TO PUT APPLICATION DATA FILE FORMATS IN THE KERNEL?

If I'm guessing right at the complexity of the Microsoft Word file format
you mention, this'll be far, far worse than the extremely simple rules that
allow protocols like FTP to be masqueraded. And even the case for FTP was
not trivial to get right (not expiring the control connection, requests
split across packets, requests fragmented, multiple requests per packet,
...)

If what you want is translation between data formats at open() time, why
can't you do it with a userspace library? For instance, today, if I want
to read almost any graphic file format into my program, and have
struct graphic_file *read_pnm_file(FILE *f)
to work with, I can easily write
struct graphic_file *read_any_file(char *path) {
char command[1024];
FILE *f;
struct graphic_file *gf;

snprintf(1024, command, "anytopnm %s", path)
fd = popen(command, "r")
if (fd == NULL) return NULL;
gf = read_pnm_file(fd);
pclose(fd);
return gf;
}

No kernel support needed, even if "path" is just the name of a directory
containing some whacked-out graphic file format where each vector primitive
is in a sub-sub-sub directory. I just modify anytopnm.

I'm sure people who are wiser than me can think up even more useful,
generic ways to do this in userspace. But doing it from the kernel? That
sounds far too clever an idea to be a good one.

Jeff

-- 
\/ http://incolor.inetnebr.com/jepler/           Jeff Epler jepler@inetnebr.com
Stay away from flying saucers today.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/