Re: [Flightgear-devel] Re: AI weirdness

2005-05-02 Thread Durk Talsma
On Monday 02 May 2005 21:23, Melchior FRANZ wrote:
 * Durk Talsma -- Monday 02 May 2005 21:16:
  I don't know what point you're trying to make: either that there is such
  a big discrepancy between the number of files that are checked for their
  precence, and the fact that there are currently none in CVS,

 Well, checking for 5 files when we can probably only expect a few
 hundreds in the next ten years seems like a waste of performance. No big
 problem on Linux with normal file systems (apart from the needless noise in
 debugging runs). But I wouldn't be surprised if this is a problem on other
 operating systems, like Win95. (Or NFS?)

 I thought the alternative approach would be obvious. Instead of checking
 for the existence of 5 possible files just ask the system for actual
 files?


Okay, thanks for clarifying. I see what you mean. I'll put this on my TODO 
list. Might take a few weeks though before I'm fully back to working on this. 
Cheers,
Durk


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: AI weirdness

2005-05-02 Thread Frederic Bouvier
Melchior FRANZ wrote :
* Durk Talsma -- Monday 02 May 2005 21:16:
 

I don't know what point you're trying to make: either that there is such a big 
discrepancy between the number of files that are checked for their precence, 
and the fact that there are currently none in CVS,
   

Well, checking for 5 files when we can probably only expect a few 
hundreds
in the next ten years seems like a waste of performance. No big problem on Linux
with normal file systems (apart from the needless noise in debugging runs). But
I wouldn't be surprised if this is a problem on other operating systems, like
Win95. (Or NFS?)
I thought the alternative approach would be obvious. Instead of checking for
the existence of 5 possible files just ask the system for actual files?
 

I didn't see a problem yet, but if we can avoid a long startup time, it 
is better.

Let me rephrase Melchior's suggestion : iterate on directories with 
plib's ulOpenDir and ulReadDir functions, possibly being recursive in 
the tree, and check if the name of the reported files are an existing 
ICAO code against the database already loaded in memory. Examples of 
directory scan are in fgadmin and in fgrun.

-Fred

___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d


Re: [Flightgear-devel] Re: AI weirdness

2005-05-02 Thread Durk Talsma
On Monday 02 May 2005 21:43, Frederic Bouvier wrote:
 Let me rephrase Melchior's suggestion : iterate on directories with
 plib's ulOpenDir and ulReadDir functions, possibly being recursive in
 the tree, and check if the name of the reported files are an existing
 ICAO code against the database already loaded in memory. Examples of
 directory scan are in fgadmin and in fgrun.

 -Fred


Okay, that would be fairly easy to do. I'll have a look.

Cheers,
Durk


___
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d