[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: magic file system implementation

From: Kai Großjohann
Subject: Re: magic file system implementation
Date: Mon, 01 Jan 2007 00:36:35 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.92 (darwin)

Nic James Ferrier <address@hidden> writes:

> I want to implement my own magic "filesystem" over stateless HTTP (I
> have the backend and a FUSE client already).
> I have a few questions:

I have no answers, but noone else has, so I can at least voice

> 1. if one of the magic filesystem functions is not relevant to me,
> what should I have that function do? For example, my filesystem cannot
> have subdirectorys, what should make-directory and
> make-directory-internal do?

Intuitively speaking, it seems they should fail.  It is not quite
clear to me, however, *how* they should fail.  But if you would make
them fail just like a normal make-directory fails when the permissions
are lacking, then that would be a good first approximation.

Since Ange-FTP is the oldest, it is always worth a look for
inspiration.  If it's been working for a decade, it can't be too

I wonder if it would make sense to standardize on some file-error text
if the failure is to signal a file-error.

> 2. Does anyone have a skeleton implementation of magic files? eldav is
> pretty good but still quite eldav specific. 

I don't...  There is not much of a skeleton to implementing magic
files, though, except for the code to recursively invoke the file
operation, which is included in the lisp manual.

> 3. What's the best prefix to register? TRAMP seems to have taken over
> magic filesystems by registering:
>   "\\`/[^/:]+:" 
> to it's handler. This makes TRAMP the fs for anything with a url
> scheme.

This is the unfortunate consequence of the traditional syntax for
remote file names in Emacs: /address@hidden:/some/file.  Tramp continues
that tradition (and evolves it).

Practically speaking, I guess that using URLs instead of Emacs' custom
syntax has theoretical appeal, but won't happen due to immediate
benefit in practice...

What can I say here?  Tramp is also a framework to hook in other
remote file handlers, see tramp-smb.el which uses smbclient.  So one
approach could be to hook into Tramp...

Can't say, tho, what you would gain from hooking into Tramp.  Filename
parsing, perhaps, but how much is that worth?

Another approach is to rely on ordering: If you come first in
file-name-handler-alist, you win.  It is because this approach exists
that I believe it is unlikely that the Emacs filename syntax will


reply via email to

[Prev in Thread] Current Thread [Next in Thread]