octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51388] Current directory does not change imme


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #51388] Current directory does not change immediatly with "cd" on some systems
Date: Fri, 14 Jul 2017 14:13:00 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46

Follow-up Comment #24, bug #51388 (project octave):

(I knew that little note of me it would induce confusing)

The subject is drifting towards file name comparison, fine, yet the actual
issue is rather that cd apparently takes so long to have effect on some
systems. Or at least, that was inferred from bug #51203.

As to the point of string comparison:

@Markus:
The code in comment #2 works fine with backward slash and fails with forward
slash.
The same results with changing strcmpi to strcmp
But see below.

Here's amended code from comment #2 and the results:

somedirectory1 = 'c:/tmp'
somedirectory2 = 'f:/tmp'

for i = 1:200
  cd (somedirectory1)
  while ~strcmp (somedirectory1, pwd)
    warning ('bug triggered  %s  <->  %s', somedirectory1, pwd);
    cd (somedirectory1)
  endwhile
  cd (somedirectory2)
  while ~strcmp (somedirectory2, pwd)
    warning ('bug triggered  %s  <->  %s', somedirectory2, pwd);
    cd (somedirectory2)
  endwhile
endfor


giving:

:
warning: bug triggered  c:/tmp  <->  c:\tmp
warning: bug triggered  c:/tmp  <->  c:\tmp
:
(repeated and repeated)


so the code in comment #2 isn't really useful for testing as-is because the
fileseps are morphed by MSYS/MinGW into the default backslash.
Changing it into:

somedirectory1 = 'c:\tmp'
somedirectory2 = 'f:\tmp'

for i = 1:200
  cd (somedirectory1)
  while ~strcmp (strrep (somedirectory1, '/', '\'), pwd)
    warning ('bug triggered  %s  <->  %s', somedirectory1, pwd);
    cd (somedirectory1)
  endwhile
  cd (somedirectory2)
  while ~strcmp (strrep (somedirectory2, '/', '\'), pwd)
    warning ('bug triggered  %s  <->  %s', somedirectory2, pwd);
    cd (somedirectory2)
  endwhile
endfor


works fine with any file separator (no bugs triggered).
So I'm tempted to conclude that cd seems to work fine.

Back to cd working slowly? and how to verify that?


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51388>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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