Re: [R] Open a file which name contains a tilde

2019-06-14 Thread Frank Schwidom
Hi John, First, the unix and linux filesystem allows the use of any nonzero character in its filesystem filenames and the c functions open / fopen, symlink. rename, chdir and so on don't care about any tilde. If the open systemcall gets a file which begins with a tilde then it will try to open

Re: [R] Open a file which name contains a tilde

2019-06-12 Thread John via R-help
On Wed, 5 Jun 2019 18:07:15 +0200 Frank Schwidom wrote: In reading file names, names with spaces require escaping of the spaces, and you are using not only a tilde but the space as spell. The tilde is conventionally read as wild card representing the leading portion of the file address, which is

Re: [R] Open a file which name contains a tilde

2019-06-10 Thread Frank Schwidom
Hi, to get rid of any possible filename modification I started a little project to cover my usecase: https://github.com/schwidom/simplefs This is my first R package, suggestions and a review are welcome. Thanks in advance Frank Schwidom On 2019-06-07 09:04:06, Richard O'Keefe wrote: >How

Re: [R] Open a file which name contains a tilde

2019-06-08 Thread Rui Barradas
Hello, R 3.6.0 on Ubuntu 19.04. Since no one mentioned it, notice that the tilde in the middle of a string needs to be surrounded by spaces to be expanded. The first code line works as expected, only the second is wrong (buggy). path.expand('a~b') #[1] "a~b" path.expand('a ~ b') #[1] "a /home

Re: [R] Open a file which name contains a tilde

2019-06-07 Thread Richard O'Keefe
?path.expand Expand a path name, for example by replacing a leading tilde by the user's home directory (if defined on that platform). *A* path name. The argument is a character vector. If multiple path names are passed, they are passed On most builds of R *A LEADING* "~user" will be

Re: [R] Open a file which name contains a tilde

2019-06-07 Thread Berry, Charles
> On Jun 6, 2019, at 2:04 PM, Richard O'Keefe wrote: > > How can expanding tildes anywhere but the beginning of a file name NOT be > considered a bug? > > I think that that IS what libreadline is doing if one allows a whitespace separated list of file names. As reported in R-help,

Re: [R] Open a file which name contains a tilde

2019-06-06 Thread Duncan Murdoch
On 06/06/2019 5:04 p.m., Richard O'Keefe wrote: How can expanding tildes anywhere but the beginning of a file name NOT be considered a bug? It looks like a bug in R, but not necessarily a bug in libreadline: we may just be using tilde_expand improperly. Duncan Murdoch On Thu, 6 Jun 2019

Re: [R] Open a file which name contains a tilde

2019-06-06 Thread Richard O'Keefe
How can expanding tildes anywhere but the beginning of a file name NOT be considered a bug? On Thu, 6 Jun 2019 at 23:04, Ivan Krylov wrote: > On Wed, 5 Jun 2019 18:07:15 +0200 > Frank Schwidom wrote: > > > +> path.expand("a ~ b") > > [1] "a /home/user b" > > > How can I switch off any file cri

Re: [R] Open a file which name contains a tilde

2019-06-06 Thread Berry, Charles
> On Jun 6, 2019, at 3:59 AM, Ivan Krylov wrote: > > On Wed, 5 Jun 2019 18:07:15 +0200 > Frank Schwidom wrote: > >> +> path.expand("a ~ b") >> [1] "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 >

Re: [R] Open a file which name contains a tilde

2019-06-06 Thread Ivan Krylov
On Wed, 5 Jun 2019 18:07:15 +0200 Frank Schwidom wrote: > +> path.expand("a ~ b") > [1] "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 correctly. Calls to path.expand [1] end up [2] in R_ExpandFileName [3],

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Enrico Schumann
Quoting Frank Schwidom : On 2019-06-05 20:32:07, Enrico Schumann wrote: > "FS" == Frank Schwidom 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 /h

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
On 2019-06-05 20:32:07, Enrico Schumann wrote: > > "FS" == Frank Schwidom writes: > > FS> Hi, > FS> As I can see via path.expand a filename which contains a tilde > anywhere gets automatically crippled. > > FS> +> path.expand("a ~ b") > FS> [1] "a /home/user b" > > FS> +>

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
On 2019-06-05 20:32:07, Enrico Schumann wrote: > > "FS" == Frank Schwidom writes: > > FS> Hi, > FS> As I can see via path.expand a filename which contains a tilde > anywhere gets automatically crippled. > > FS> +> path.expand("a ~ b") > FS> [1] "a /home/user b" > > FS> +>

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Enrico Schumann
> "FS" == Frank Schwidom writes: FS> Hi, FS> As I can see via path.expand a filename which contains a 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"

[R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
Hi, As I can see via path.expand a filename which contains a tilde anywhere gets automatically crippled. +> path.expand("a ~ b") [1] "a /home/user b" +> path.expand("a ~ b ~") [1] "a /home/user b /home/user" I want to open a file regardless whether its name contains any character unless 0. T