> > I'll check why the rmdir command is not working as expected.
> 
> I just poked around and couldn't figure out the cause.  Initdb should
> either remove the directory if it created it, or remove everything
_in_
> the directory if the directory already existed.  I tried the rmdir/del
> /s /q commands in a CMD window and it worked fine.

Problem is backslash issue :) initdb is issuing del /s /q
"c:/postgres/data".

Is there a library command to properly resolve slashes?

Merlin



Mon, 26 Apr 2004 14:05:10 -0400
"Merlin Moncure" <merlin.moncure@rcsonline.com>
Re: FW: getting a crash during initdb
Merlin Moncure wrote:
> > > I'll check why the rmdir command is not working as expected.
> > 
> > I just poked around and couldn't figure out the cause.  Initdb should
> > either remove the directory if it created it, or remove everything
> _in_
> > the directory if the directory already existed.  I tried the rmdir/del
> > /s /q commands in a CMD window and it worked fine.
> 
> Problem is backslash issue :) initdb is issuing del /s /q
> "c:/postgres/data".
> 
> Is there a library command to properly resolve slashes?

Uh, I just testd this using CMD and it worked:

	rmdir /s /q "C:/TMP/TMP"

The quotes are required, but are in the code:

    snprintf(buf, sizeof(buf), "%s /s /q \"%s\"",
             rmtopdir ? "rmdir" : "del", path);

However, I have no problem with pulling his rmdir C code back out of CVS
and implementing it.  I think it might come in as part of tablespaces
anyway so I was just waiting to see how things shook out.  If we do it,
it would go into /port along with copdir/dp for directories.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 26 Apr 2004 14:28:31 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: FW: getting a crash during initdb