Re: File system errors: "cannot get current working directory"

From: Bela Lubkin (belal_at_sco.com)
Date: 09/30/03


Date: 29 Sep 2003 22:22:31 -0400

John DuBois wrote:

> In article <20030929170444.A21187@egps.egps.com>,
> Nachman Yaakov Ziskind <awacs@egps.com> wrote:
> >/u/qt/backup: l
> >l: warning: cannot get current working directory: Not a directory (error 20)
> >l: . not found: Not a directory (error 20)
> >
> >Now, a simple cd command (to the same directory) will solve my problem, but
> >what's going on here?
>
> The directory has been removed. Since it doesn't exist, it can't be referenced
> with '.'. A new directory may have been created where it was, but that isn't
> the directory you're in - your current directory is identified by inode, not
> path.

And you can confirm this. Before running the command that causes the
problem, run:

  $ l # verify it works
  $ l -id . # notice the inode number

Then do the command that causes the problem. Then:

  $ l # fails with "cannot get working directory"
  $ cd same
  $ l -id . # notice the _different_ inode number

>Bela<