Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Unix.openfile share mode #5420
Original bug ID: 5420
In MSVC port Unix.openfile opens files with FILE_SHARE_READ and FILE_SHARE_WRITE, but without FILE_SHARE_DELETE. Patch is attached.
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.