> On Jun 6, 2019, at 3:59 AM, Ivan Krylov <krylov.r...@gmail.com> wrote:
> On Wed, 5 Jun 2019 18:07:15 +0200
> Frank Schwidom <schwi...@gmx.net> wrote:
>> +> path.expand("a ~ b")
>>  "a /home/user b"
>> How can I switch off any file crippling activity?
> It doesn't seem to be possible if readline is enabled and works
> Calls to path.expand  end up  in R_ExpandFileName , which
> calls R_ExpandFileName_readline , which uses libreadline function
> tilde_expand . tilde_expand seems to be designed to expand '~'
> anywhere in the string it is handed, i.e. operate on whole command
> lines, not file paths.
FWIW, the tilde does not always trigger this behavior.
It seems that the tilde needs to be first in the string or preceded by
whitespace and succeeded by whitespace or a path separator so the result looks
like a path.
> path.expand("~/abc/ ~/def")
 "/Users/cberry/abc/ /Users/cberry/def"
> path.expand("~/abc/ ~tilde~/def")
 "/Users/cberry/abc/ ~tilde~/def"
> path.expand("~/abc/ ~tilde ~/def")
 "/Users/cberry/abc/ ~tilde /Users/cberry/def"
An inelegant workaround could be built by adding escapes to the initial path
and stripping them from the result.
Perhaps, the intent (in GNU deadline) was to allow a string with multiple paths
separated by whitespace to be processed.
Maybe this is seen as a feature in GNU readline even though it is not helpful
Rfirstname.lastname@example.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.