|
10 | 10 | *Win32 (NT, Win2k, XP).replace() doesn't work on Win95/98/Me.
|
11 | 11 | *
|
12 | 12 | * IDENTIFICATION
|
13 |
| - * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.38 2005/08/02 15:14:47 tgl Exp $ |
| 13 | + * $PostgreSQL: pgsql/src/port/dirmod.c,v 1.39 2005/08/10 19:52:37 momjian Exp $ |
14 | 14 | *
|
15 | 15 | *-------------------------------------------------------------------------
|
16 | 16 | */
|
@@ -118,7 +118,11 @@ pgrename(const char *from, const char *to)
|
118 | 118 | {
|
119 | 119 | intloops=0;
|
120 | 120 |
|
121 |
| -/* Is this loop even necessary now that we have win32_open()? */ |
| 121 | +/* |
| 122 | + *We need these loops because even though PostgreSQL uses flags |
| 123 | + *that allow rename while the file is open, other applications |
| 124 | + *might have these files open without those flags. |
| 125 | + */ |
122 | 126 | #if defined(WIN32)&& !defined(__CYGWIN__)
|
123 | 127 | while (!MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING))
|
124 | 128 | #endif
|
@@ -164,7 +168,11 @@ pgunlink(const char *path)
|
164 | 168 | {
|
165 | 169 | intloops=0;
|
166 | 170 |
|
167 |
| -/* Is this loop even necessary now that we have win32_open()? */ |
| 171 | +/* |
| 172 | + *We need these loops because even though PostgreSQL uses flags |
| 173 | + *that allow unlink while the file is open, other applications |
| 174 | + *might have these files open without those flags. |
| 175 | + */ |
168 | 176 | while (unlink(path))
|
169 | 177 | {
|
170 | 178 | if (errno!=EACCES)
|
|