Skip to content
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

Closed
vicuna opened this issue Dec 12, 2011 · 4 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Dec 12, 2011

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

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 12, 2011

Comment author: johnlepikhin

I'm sorry, file pcre-ocaml.patch was attached by mistake.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 12, 2011

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.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 13, 2011

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.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 13, 2011

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.

@vicuna vicuna closed this Sep 25, 2012

@vicuna vicuna added the bug label Mar 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.