# README.map.txt

2010-04-17: Some notes...

1. Finding the SCENERY
----------------------

If you do NOT have FG_ROOT nor FG_SCENERY set, and
you do NOT give a --fg-scenery=<DIR>, but do give
--fg-root=<DIR>, map will NEVER find the scenery!

It tries using the fg-root, but ONLY adds 'Terrain'!
It should add 'Scenery' first...

If FG_ROOT is in the environment, then the code
    env = getenv("FG_SCENERY");
    if (env == NULL) {
        fg_scenery.set(fg_root.str());
should be
        fg_scenery.set(fg_root.str());
        fg_scenery.append("Scenery");
        
2. Creating the MAPS
--------------------

If you create once, then Map detects the files exist,
and does NOTHING. That is good...

If you then delete one folder, say the '10', then
Map will FAIL to re-create 10, thus FAIL to write
the Maps...

Maybe this is something to do with the SGPath class
NOT correctly reporting 'directories'.exist(). It uses
open( "dir", "r" ) succeeds, but in windows open a
directory will ALWAYS fail.

3. SGPath problems in windows
-----------------------------

As suggested above, SGPath.exists() FAILS if the
path is a directory.

So the code in Tiles.cxx of -
   if (!_maps.exists() && createDirs) {
      if (_maps.create_dir(0755) < 0) {
        // If we can't create it, throw an error.
        throw runtime_error("couldn't create maps directory");
	  }
   }
would ALWAYS be run, but thankfully SGPath.create() returns
0, and not an error, if the path already exists...

I added a NEW, windows only at present, service,
bool is_valid_path( std::string path );
where I used 'stat', instead of 'open'.

But this needed some checking if a trailing '/'
had been added, since 'stat' will FAIL if there
is a trainling '/'.

Note that SGPath unconditionally, and ALWAYS uses
a '/' path separator.

# EOF - REDME.map.txt

