GNU bug report logs -
#10319
24.0.92; doc string of `file-remote-p'
Previous Next
Reported by: "Drew Adams" <drew.adams <at> oracle.com>
Date: Sun, 18 Dec 2011 02:20:01 UTC
Severity: minor
Found in version 24.0.92
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
"Drew Adams" <drew.adams <at> oracle.com> writes:
>> The second sentence means that a relative filename like
>> "/sudo::../../.." does not make sense, because it cannot
>> expand out of the "/sudo::" jail.
>
> So what are we trying to tell _users_ here?
> Is this what we are really trying to say?
>
> FILE must be an absolute file name.
>
> If so, what should we say happens if you nevertheless pass a relative
> file name? Return value is unspecified (could be nil or non-nil)? An
> error is raised? What should we tell users is the behavior?
Any relative filename cannot expand to a different remote connection, or
a filename of your local filesystem. But you are right, this information
is irrelevant for the docstring of `file-remote-p'.
>> > We should also perhaps say what "the complete
>> > identification" is/means. IOW, when IDENTIFICATION is nil,
>> > what can we say about the return value?
>>
>> In that case, the returned string could make a local file
>> name remote. We could always offer to apply
>> (concat (file-remote-p "whatever") "local-file-name")
>> given that `concat' accepts nil as argument.
>
> Sorry, I just don't understand your reply to my question (what is the
> complete identification - what is returned if IDENTIFICATION is nil).
> Could you rephrase or elaborate?
When IDENTIFICATION is nil, the returned string is everything until the
last ":" (with expanded default method, default user, default host).
(file-remote-p "/sudo::/") => "/sudo:root <at> localhost:"
(file-remote-p "/localhost:/") => "/scpc:localhost:"
What I have tried to explain is a common technique for creation of new
remote filenames, derived from an existing one. Let's say you have a
variable `file' containing the remote filename "/sudo::/path/to/file",
and you want to create a new remote filename for the file "/bin/sh". You
apply then (concat (file-remote-p file) "/bin/sh")
> Thx - Drew
Best reards, Michael.
This bug report was last modified 13 years and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.