Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8bbf227

Browse files
committed
Document why Win32 loops over rename/unlink are necessary.
1 parente38c920 commit8bbf227

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

‎src/port/dirmod.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*Win32 (NT, Win2k, XP).replace() doesn't work on Win95/98/Me.
1111
*
1212
* 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 $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -118,7 +118,11 @@ pgrename(const char *from, const char *to)
118118
{
119119
intloops=0;
120120

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+
*/
122126
#if defined(WIN32)&& !defined(__CYGWIN__)
123127
while (!MoveFileEx(from,to,MOVEFILE_REPLACE_EXISTING))
124128
#endif
@@ -164,7 +168,11 @@ pgunlink(const char *path)
164168
{
165169
intloops=0;
166170

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+
*/
168176
while (unlink(path))
169177
{
170178
if (errno!=EACCES)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp