New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unix.openfile share mode #5420
Comments
Comment author: johnlepikhin I'm sorry, file pcre-ocaml.patch was attached by mistake. |
Comment author: @alainfrisch 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. |
Comment author: johnlepikhin 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. |
Comment author: @alainfrisch 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. |
Original bug ID: 5420
Reporter: johnlepikhin
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2012-09-25T18:07:21Z)
Resolution: fixed
Priority: low
Severity: minor
Platform: MSVC
OS: Windows
Version: 3.12.1
Category: ~DO NOT USE (was: OCaml general)
Bug description
In MSVC port Unix.openfile opens files with FILE_SHARE_READ and FILE_SHARE_WRITE, but without FILE_SHARE_DELETE. Patch is attached.
File attachments
The text was updated successfully, but these errors were encountered: