|
39 | 39 | * Portions Copyright (c) 1994, Regents of the University of California |
40 | 40 | * Portions taken from FreeBSD. |
41 | 41 | * |
42 | | - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.45 2004/08/0105:59:13 momjian Exp $ |
| 42 | + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.46 2004/08/0106:19:23 momjian Exp $ |
43 | 43 | * |
44 | 44 | *------------------------------------------------------------------------- |
45 | 45 | */ |
@@ -146,7 +146,6 @@ char backend_exec[MAXPGPATH]; |
146 | 146 |
|
147 | 147 | staticvoid*xmalloc(size_tsize); |
148 | 148 | staticchar*xstrdup(constchar*s); |
149 | | -staticboolrmtree(char*path,boolrmtopdir); |
150 | 149 | staticchar**replace_token(char**lines,char*token,char*replacement); |
151 | 150 | staticchar**readfile(char*path); |
152 | 151 | staticvoidwritefile(char*path,char**lines); |
@@ -251,30 +250,6 @@ xstrdup(const char *s) |
251 | 250 | returnresult; |
252 | 251 | } |
253 | 252 |
|
254 | | -/* |
255 | | - * delete a directory tree recursively |
256 | | - * assumes path points to a valid directory |
257 | | - * deletes everything under path |
258 | | - * if rmtopdir is true deletes the directory too |
259 | | - */ |
260 | | -staticbool |
261 | | -rmtree(char*path,boolrmtopdir) |
262 | | -{ |
263 | | -charbuf[MAXPGPATH+64]; |
264 | | - |
265 | | -#ifndefWIN32 |
266 | | -/* doesn't handle .* files, but we don't make any... */ |
267 | | -snprintf(buf,sizeof(buf),"rm -rf \"%s\"%s",path, |
268 | | -rmtopdir ?"" :"/*"); |
269 | | -#else |
270 | | -snprintf(buf,sizeof(buf),"%s /s /q \"%s\"", |
271 | | -rmtopdir ?"rmdir" :"del",path); |
272 | | -#endif |
273 | | - |
274 | | -return !system(buf); |
275 | | -} |
276 | | - |
277 | | - |
278 | 253 | /* |
279 | 254 | * make a copy of the array of lines, with token replaced by replacement |
280 | 255 | * the first time it occurs on each line. |
|