octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cd


From: Benjamin Lindner
Subject: Re: cd
Date: Wed, 27 Aug 2008 15:35:23 +0200
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)



Jaroslav Hajek wrote:
On Wed, Aug 27, 2008 at 1:07 PM, Levente Torok <address@hidden> wrote:

On Wed, Aug 27, 2008 at 9:45 AM, Olaf Till <address@hidden> wrote:
On Tue, Aug 26, 2008 at 05:17:03PM -0400, John W. Eaton wrote:
On 25-Aug-2008, Levente Torok wrote:

| Hi All,
|
| I ran into an other simple compatibility issue:
| In octave, 'cd' does not return anything however it should (pwd).

Yes, this is a known "problem".  I'd consider a patch.

But one thing that should not be "fixed" is that cd by itself should
change the current directory to $HOME.  ...
Agree that this should not be "fixed", but wouldn't it be weird then
if the current directory is printed before 'cd' changes to the home
directory?  Olaf

If matlab compatilibity is a target, than it should follow what matlab does.
In matlab "cd" return the current dir and does not change it!.
"cd ~"
returns nothing but changes curr dir.


Matlab compatibility matters, but is not an absolute rule. Most of
Octave users use also other tools than Matlab. When you have such an
ubiquitous command such as cd, you should consider compatibility in a
more general sense. "cd" without arguments always meant "cd ~" on
Unix. Matlab's behaviour is apparently modeled after "cd" in DOS
(which knew nothing about home directories).
Though I'm sure that Windoze users are an important group (perhaps
even most important), I bet that most of them actually do not use
Windows command line much, while most of Linux and Mac users probably
do.
But I'm not sure about this. Perhaps some Windows users could tell us
whether they care about this matter. If they don't, I'd vote for not
changing the behaviour.

Speaking as windows user, I do not see a problem here if the "cd" command behaves in the standard-unix way. Windows does not provide a really useful terminal, and obviously never put emphasis into it, so win32 behaviour at the console should not be the reference IMO.

I personally use win32 command line quite a bit, but to retrieve the current working directory it is much less complicated to read the CD environment variable than reading the output of a "cd" command, so I don't use it. What I wanted to express is, reading the cwd in win32 console, you would not call the "cd" command, so I see no point why the cd command in octave should return the cwd *for this reason alone*.

Matlab compatibility is a different matter.
Again, personally, I would not follow matlab's conventions in this case. I like the "compatibility in a more general sense" as commented above.

benjamin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]