Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005420OCamlOCaml generalpublic2011-12-12 09:132012-09-25 20:07
Reporterjohnlepikhin 
Assigned Tofrisch 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformMSVCOSWindowsOS Version
Product Version3.12.1 
Target VersionFixed in Version 
Summary0005420: Unix.openfile share mode
DescriptionIn MSVC port Unix.openfile opens files with FILE_SHARE_READ and FILE_SHARE_WRITE, but without FILE_SHARE_DELETE. Patch is attached.
TagsNo tags attached.
Attached Filespatch file icon pcre-ocaml.patch [^] (1,255 bytes) 2011-12-12 09:13 [Show Content]
patch file icon ocaml-msvc-open-bug.patch [^] (622 bytes) 2011-12-12 16:22 [Show Content]

- Relationships

-  Notes
(0006242)
johnlepikhin (reporter)
2011-12-12 16:22

I'm sorry, file pcre-ocaml.patch was attached by mistake.
(0006252)
frisch (developer)
2011-12-12 21:44

It seems to be that the "standard" behavior under Windows is that when a file is opened by an application, it cannot be deleted by another one (my understanding is that your patch changes this). Anyway, this is the behavior OCaml used to reflect in the Unix module, and some applications could rely on it (and actually we do rely on this behavior at LexiFi in one specific place of our codebase); so I'm reluctant to integrate your patch.

One could imagine extending the interface with an optional argument (ignored under Unix?). But I tend to believe that a nice coverage of the Win32 API should probably be implemented in a separate library.
(0006259)
johnlepikhin (reporter)
2011-12-13 04:50
edited on: 2011-12-13 12:12

At this time Unix.openfile have different behavior on UNIX and Windows. One can have difficulties while developing cross-platform applications (I had it, and I wasted several hours to find what is blocking deletion of files on production servers where dozens of users and active applications). So if patch will not be integrated, this difference at least must be noted in documentation of Unix.openfile.

(0006272)
frisch (developer)
2011-12-13 17:55

I've added a flag Unix.O_SHARE_DELETE, which can be passed to Unix.openfile (it does not nothing under Unix). This is available in the SVN trunk. Let me know if it works for you.

- Issue History
Date Modified Username Field Change
2011-12-12 09:13 johnlepikhin New Issue
2011-12-12 09:13 johnlepikhin File Added: pcre-ocaml.patch
2011-12-12 16:22 johnlepikhin File Added: ocaml-msvc-open-bug.patch
2011-12-12 16:22 johnlepikhin Note Added: 0006242
2011-12-12 21:44 frisch Note Added: 0006252
2011-12-13 04:50 johnlepikhin Note Added: 0006259
2011-12-13 12:12 johnlepikhin Note Edited: 0006259 View Revisions
2011-12-13 17:20 frisch Assigned To => frisch
2011-12-13 17:20 frisch Status new => assigned
2011-12-13 17:55 frisch Note Added: 0006272
2011-12-13 17:55 frisch Status assigned => feedback
2011-12-21 13:09 frisch Status feedback => resolved
2011-12-21 13:09 frisch Resolution open => fixed
2012-09-25 20:07 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker