[htdig3-dev] Re: Status & Moving files


Subject: [htdig3-dev] Re: Status & Moving files
From: Geoff Hutchison (ghutchis@wso.williams.edu)
Date: Tue Feb 01 2000 - 20:13:38 PST


Hi,

OK, I'm just about done fixing up the htcommon/defaults.cc and
regenerating the attribute documentation. With this, I think I'll be
ready to roll a pre-release sometime tomorrow afternoon.

One question came up as far as the htfuzzy/EndingsDB.cc. In the 3-1-x
branch, the code was this:
     //
     // Since we used files in TMPDIR for our temporary databases, we need
     // to now move them to the correct location as defined in the config
     // database.
     //
     system(form("/bin/mv %s %s;/bin/mv %s %s",
                 root2word.get(), config["endings_root2word_db"],
                 word2root.get(), config["endings_word2root_db"]));

Now this is a bug because mv isn't always in /bin/mv! So I initially
thought that I'd just change this to (this is the current CVS
version):
     link(root2word.get(), config["endings_root2word_db"]);
     unlink(root2word.get());
     link(word2root.get(), config["endings_word2root_db"]);
     unlink(word2root.get());

Well this is nicely portable, but wrong as Gilles pointed out--it
will fail when we're trying to move across filesystems. :-(

I was going to change "back" to the system call and just use "mv"
instead of "/bin/mv" which will find it in the current environment's
PATH. Does this still seem safe?

Obviously this close to release, I don't want to break anything, but
it seems fairly obvious to me. Am I missing something?

-Geoff

------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
htdig3-dev-unsubscribe@htdig.org
You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Tue Feb 01 2000 - 20:16:01 PST