Tilde expansion problems

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tilde expansion problems

Hugo Raguet
I encountered some problems with tilde expansion.

It seems that
    > mkdir('~/foo/bar')
actually creates the directories 'bar' and 'foo' within a directory '~'
in the current workspace. Is the lack of tilde expansion intentional?

Moreover, I know that for instance the function
    > exist('~/foo/bar')
_would find_ '$HOME/foo/bar', but it finds also an actual '~/foo/bar'
within the current workspace.

I had trouble, because in some script, I use
    > if not(exist('~/foo/bar')), mkdir('~/foo/bar'), end
and it took me some times to understand why it does not create
'$HOME/foo/bar', and why 'exist('~/foo/bar')' evaluates to 1 consequently.

Should we do something about this?
Hugo



-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Tilde expansion problems

Mike Miller-4
On Fri, Jan 26, 2018 at 19:53:37 +0100, Hugo Raguet wrote:
> I encountered some problems with tilde expansion.
>
> It seems that
>     > mkdir('~/foo/bar')
> actually creates the directories 'bar' and 'foo' within a directory '~'
> in the current workspace. Is the lack of tilde expansion intentional?

Unfortunately I think this is an accidental regression.

In Octave 4.0, it was not possible for mkdir to create missing
intermediate directories. When this feature was added, I believe the
tilde expansion was broken.

> Should we do something about this?

Yes, please file a bug report about this. And please verify if you can
that tilde expansion does work in Octave 4.0.

--
mike


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Tilde expansion problems

Sahil
Works fine in 4.0.0 but breaks in developmental build.


Sahil


Mike Miller-4 wrote

> On Fri, Jan 26, 2018 at 19:53:37 +0100, Hugo Raguet wrote:
>> I encountered some problems with tilde expansion.
>>
>> It seems that
>>     > mkdir('~/foo/bar')
>> actually creates the directories 'bar' and 'foo' within a directory '~'
>> in the current workspace. Is the lack of tilde expansion intentional?
>
> Unfortunately I think this is an accidental regression.
>
> In Octave 4.0, it was not possible for mkdir to create missing
> intermediate directories. When this feature was added, I believe the
> tilde expansion was broken.
>
>> Should we do something about this?
>
> Yes, please file a bug report about this. And please verify if you can
> that tilde expansion does work in Octave 4.0.
>
> --
> mike
>
>
> -----------------------------------------
> Join us March 12-15 at CERN near Geneva
> Switzerland for OctConf 2018.  More info:
> https://wiki.octave.org/OctConf_2018
> -----------------------------------------
>
>
> signature.asc (849 bytes)
> <http://octave.1599824.n4.nabble.com/attachment/4686456/0/signature.asc>





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Tilde expansion problems

Mike Miller-4
In reply to this post by Mike Miller-4
On Fri, Jan 26, 2018 at 11:31:16 -0800, Mike Miller wrote:
> Yes, please file a bug report about this. And please verify if you can
> that tilde expansion does work in Octave 4.0.

I haven't seen a report yet, so I filed https://savannah.gnu.org/bugs/?53031

--
mike


-----------------------------------------
Join us March 12-15 at CERN near Geneva
Switzerland for OctConf 2018.  More info:
https://wiki.octave.org/OctConf_2018
-----------------------------------------

signature.asc (849 bytes) Download Attachment