Re: FW: getting a crash during initdb - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: FW: getting a crash during initdb
Date
Msg-id 200404261828.i3QISVW15997@candle.pha.pa.us
Whole thread Raw
In response to FW: getting a crash during initdb  ("Merlin Moncure" <merlin.moncure@rcsonline.com>)
List pgsql-hackers
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,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: "Glen Parker"
Date:
Subject: FW: Do we prefer software that works or software that looks good?
Next
From: pgsql@mohawksoft.com
Date:
Subject: Re: Usability, MySQL, Postgresql.org, gborg, contrib, etc.