[R] Open a file which name contains a tilde

Enrico Schumann e@ @end|ng |rom enr|co@chum@nn@net
Thu Jun 6 08:07:28 CEST 2019


Quoting Frank Schwidom <schwidom using gmx.net>:

> On 2019-06-05 20:32:07, Enrico Schumann wrote:
>> >>>>> "FS" == Frank Schwidom <schwidom using gmx.net> writes:
>>
>>     FS> Hi,
>>     FS> As I can see via path.expand a filename which contains a     
>>  FS> tilde anywhere gets automatically crippled.
>>
>>     FS> +> path.expand("a ~ b")
>>     FS> [1] "a /home/user b"
>>
>>     FS> +> path.expand("a ~ b ~")
>>     FS> [1] "a /home/user b /home/user"
>>
>>     FS> I want to open a file regardless whether its name contains   
>>    FS> any character unless 0.
>>
>>     FS> The unix filesystem allow the creation of such files, it     
>>  FS> sould be possible to open these.
>>
>>     FS> How can I switch off any file crippling activity?
>>
>>     FS> Kind regards,
>>     FS> Frank
>>
>> Do you need 'path.expand'? For example,
>>
>>     readLines("~/Desktop/a ~ b")
>>
>> reads just fine the content of a file named
>> 'a ~ b' on my desktop.
>>
>
> Appendix:
>
> I found out in the meantime that I can use 'R --no-readline' but I  
> want to use readline and I found no possible readline configuration  
> /etc/inputrc).
>
> And maybe it works as Rscript.
>
> But that should be more consistent because it is in fact very basic.
>
> Kind regards,
> Frank

You're right. I ran the example from Emacs/ESS.
There it worked, but only because ESS uses '--no-readline'
as a default (i.e. 'ess-R-readline' is set to nil).
With readline enabled, it fails (with R 3.6.0).


-- 
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net



More information about the R-help mailing list