Dear Alfred,

>
> >   http://www.freebsd.org/cgi/query-pr.cgi?pr=24315
> > 
> > The summary is that getcwd(3) under Linux emulation will fail really
> > hard after a rmdir.
> > 
> 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)?
> 
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
 
BUILD FAILED

java.io.FileNotFoundException: iÉ/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

================================================
 You are only young once,
       but you can stay immature all your life.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to