problem with File.list() method

Archie Cobbs archie at whistle.com
Mon Sep 13 15:43:15 PDT 1999


[ replying to an old message.. ]

Moses DeJong writes:
> I have been running into some problems with the current CVS version of
> Kaffe so I thought I would bounce what I have found so far off folks
> on the list so that I might get some help.
> 
> Here is a example class that fails with the current CVS build
> of Kaffe on my system (RedHat 5.2 Intel system with kernel 2.2.9).
> The problem is with the File.list() method, it just returns null.
> 
 ...
> 
> libraries/clib/io/File.c : Line 222
> 
> /*
>  * Get a directory listing.
>  */
> HArrayOfObject* /* [Ljava.lang.String; */
> java_io_File_list0(struct Hjava_io_File* this)
> {
> #if defined(DIR) /* Windows hack - XXX */
> 	char path[MAXPATHLEN];
> 
> ...
> 
> #else
> 	return (0);
> #endif
> }
> 
> The problem seems to be that this DIR symbol is not defined
> and that means the code in the method never compiles.

The "#if defined(DIR)" is wrong because it incorrectly assumes that
dirent.h will define DIR as a macro and not a typedef. Not sure
what the Windows problem is here but it would be better addressed
with a windows specific test. I'm fixing the test to test for
HAVE_DIRENT_H instead.. this may break Windows builds but if so
hopefully somebody who uses Windows can figure out a fix for that.

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list