all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kai@emptydomain.de (Kai Großjohann)
Subject: Re: magic file system implementation
Date: Mon, 01 Jan 2007 00:36:35 +0100	[thread overview]
Message-ID: <m2lkknhc3g.fsf@slowfox.dyndns.org> (raw)
In-Reply-To: 87ejqq0y5n.fsf@tapsellferrier.co.uk

Nic James Ferrier <nferrier@tapsellferrier.co.uk> 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
suggestions.

> 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
wrong.

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: /user@host:/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
change.


Kai

  parent reply	other threads:[~2006-12-31 23:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-24  3:29 magic file system implementation Nic James Ferrier
2006-12-25 23:23 ` Stefan Monnier
2006-12-31 23:36 ` Kai Großjohann [this message]
2006-12-31 23:40   ` Kai Großjohann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2lkknhc3g.fsf@slowfox.dyndns.org \
    --to=kai@emptydomain.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.