|
From: | Lars Hansen |
Subject: | Re: file-relative-name and remote files |
Date: | Sun, 23 Feb 2003 16:42:27 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2.1) Gecko/20021130 |
IMHO, the following might work: file-relative-name finds a filename handler for the filename and one for the directory. If they are different, then the two must come from different handlers, so do like the different-drives case. If they are equal, invoke the handler. This requires a new file operation, file-relative-name. It seems to work for Ange-FTP and Tramp. However... Imagine that there was a filename handler which could look inside of tar files, so that the filename /tmp/foo.tar/x/y would extract the file x/y from the tarball /tmp/foo.tar. So should (file-relative-name "/tmp/foo.tar/x/y" "/tmp") eval to "foo.tar/x/y" or not?
What about changing it to:file-relative-name finds a filename handler for the filename and one for the directory. If they are non-nil and different, then the two must come from different handlers, so do like the different-drives case. If they are non-nil and equal, or one is non-nil and the other nil, invoke the handler. If both are nil, execute the build in code.
Then the handler can decide what to do when one of the files is an ordinary one, and in your example it could return "foo.tar/x/y".
[Prev in Thread] | Current Thread | [Next in Thread] |