summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 16:32:47 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-23 16:32:47 +0000
commit427c2754e990184d675e4adbda750925b84935a3 (patch)
tree799620b97fe34fd9bd8ec8dcb61fb48dda174b47 /file.c
parent4f85b9edfbe5906ba69c36af0139d69d4f243706 (diff)
* file.c (w32_io_info): CreateFile failed on Win9x if file was already
opened. (FILE_SHARE_READ was needed, but actually I don't understand the flags of CreateFile well...) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/file.c b/file.c
index ca8bdf2f90..92bbf89512 100644
--- a/file.c
+++ b/file.c
@@ -655,7 +655,8 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
}
else {
FilePathValue(*file);
- f = CreateFile(StringValueCStr(*file), 0, 0, NULL, OPEN_EXISTING,
+ f = CreateFile(StringValueCStr(*file), 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (f == INVALID_HANDLE_VALUE) return FALSE;
}