This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [1.7] bug in chdir


On Jul 14 21:47, Eric Blake wrote:
> $ ls //home
> ls: reading directory //home: No such file or directory
> $ # makes sense; I don't have a remote machine named home
> $ cd //home
> $ # huh? no error reported?
> $ /bin/pwd # avoid shortcuts in bash builtin; /bin/pwd uses getcwd
> //home

Sorry Eric, but I can't reproduce this.  I tried it on XP and 2K8R2
with identical result.

That's what I get in bash:

  corinna@cathi ~
  $ ls //home
  ls: cannot access //home: No such file or directory

  corinna@cathi ~
  $ cd //home
  bash: cd: //home: No such file or directory

  corinna@cathi ~
  $

And that's what I get in dash:

  $ ls //home
  ls: cannot access //home: No such file or directory
  $ cd //home
  cd: 2: can't cd to //home
  $ 

> $ dash -c 'CDPATH=/; cd home'
> //home

On my systems this result in:

  $ dash -c 'CDPATH=/; cd home'
  cd: 1: can't cd to home

I also tried a simple test application which removes the shell
magic from the picture:

  #include <stdio.h>

  int
  main (int argc, char **argv)
  {
    int ret = 0;
    if (argc > 1)
      ret = chdir (argv[1]);
    if (ret)
      perror ("chdir");
    return 0;
  }

  $ gcc -g -o chdir chdir.c
  $ ./chdir //home
  chdir: No such file or directory
  $

If you're able to cd to //home, then there must be some crucial
difference in your environment.  You should debug this, at least with
strace, so we can find out under what circumstances this occurs.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]