From owner-freebsd-hackers Wed May 23 4: 2: 6 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from l04.research.kpn.com (l04.research.kpn.com [139.63.192.204]) by hub.freebsd.org (Postfix) with ESMTP id 253D837B424 for ; Wed, 23 May 2001 04:02:03 -0700 (PDT) (envelope-from K.J.Koster@kpn.com) Received: by l04.research.kpn.com with Internet Mail Service (5.5.2653.19) id ; Wed, 23 May 2001 13:02:02 +0100 Message-ID: <59063B5B4D98D311BC0D0001FA7E452205FD9C04@l04.research.kpn.com> From: "Koster, K.J." To: 'Alfred Perlstein' Cc: 'FreeBSD Hackers mailing list' Subject: RE: Linux getcwd problems Date: Wed, 23 May 2001 13:02:01 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dear Alfred, > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=3D24315 > >=20 > > The summary is that getcwd(3) under Linux emulation will fail = really > > hard after a rmdir. > >=20 > I've looked at your email and the PR, the problem that I have is that > I have no clue as to what it should return. Can you give a = suggestion > and possibly site a refernece? Basically, WWLD (what would linux = do)? >=20 Umm. I'm confused. WLWD is give me a useful value for cwd, given that = my cwd actually exists. What I see is this: % touch build.xml % mkdir gen % rmdir gen % ant Buildfile: build.xml =20 BUILD FAILED java.io.FileNotFoundException: i=C9/build.xml (No such file or = directory) ^^- note this It looks like that after a directory was removed from the cwd, the = Linux getcwd command returns garbage. The JDK uses getcwd routinely, to set = the user.dir (or some such) property. Ant uses that property to determine = what file to open, i.e. it opens (in a mix of C, Java and pseudocode): new FileInputStream(linux_getcwd() + "/build.xml") Since getcwd() returns garbage after a directory was deleted from the = cwd, the above fails with the exception mentioned earlier. I think it is safe to assume that on a Linux system, getcwd() returns meaningful information every time, under normal circumstances. :-) This is about as clear as I can describe the problem. Hope this helps. > > Instead of asking why a piece of software is using "1970s = technology," > start asking why software is ignoring 30 years of accumulated wisdom. > Because today I know better. [Ghandi] :-) Kees Jan =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= You are only young once, but you can stay immature all your life. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message