List:Internals« Previous MessageNext Message »
From:Roger Larsson Date:December 3 2000 10:28pm
Subject:mysql-3.23.28 NT, binary files opened as read-only
View as plain text  
Hi,
I've noticed taht as of 3.23.28 all binary files are created as
read-only under Windows NT. The problem is the call to open()
under NT, if O_CREAT is specified, the third parameter (pmode) to
open() is mandatory. If the file does already exist, the parameter is
ignored. I assume it is not intentional to create the files as
read-only.

I suggest the patch below.

Best regards,
/Roger Larsson

*** E:\TEMP\my_open.cdDAQBA	Sun Dec 03 22:25:02 2000
--- E:\TEMP\my_open.c.savedDAdLG	Sun Dec 03 22:25:02 2000
***************
*** 17,23 ****

  #define USES_TYPES
  #include "mysys_priv.h"
- #include <my_dir.h>
  #include "mysys_err.h"
  #include <errno.h>
  #if defined(MSDOS) || defined(__WIN__)
--- 17,22 ----
***************
*** 37,47 ****
  		   FileName, Flags, MyFlags));
  #if defined(MSDOS) || defined(__WIN__)
    if (Flags & O_SHARE)
!     fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, 
SH_DENYNO,
!                MY_S_IREAD | MY_S_IWRITE);
    else
!     fd = open((my_string) FileName, Flags | O_BINARY,
!               MY_S_IREAD | MY_S_IWRITE);
  #elif !defined(NO_OPEN_3)
    fd = open(FileName, Flags, my_umask);	/* Normal unix */
  #else
--- 36,44 ----
  		   FileName, Flags, MyFlags));
  #if defined(MSDOS) || defined(__WIN__)
    if (Flags & O_SHARE)
!     fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, 
SH_DENYNO);
    else
!     fd = open((my_string) FileName, Flags | O_BINARY);
  #elif !defined(NO_OPEN_3)
    fd = open(FileName, Flags, my_umask);	/* Normal unix */
  #else


_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

Thread
mysql-3.23.28 NT, binary files opened as read-onlyRoger Larsson3 Dec
  • Re: mysql-3.23.28 NT, binary files opened as read-onlySinisa Milivojevic4 Dec
  • Re: mysql-3.23.28 NT, binary files opened as read-onlySasha Pachev4 Dec
  • mysql-3.23.28 NT, binary files opened as read-onlyMichael Widenius5 Dec
  • Compile optionsAntony T Curtis5 Dec
    • Compile optionsMichael Widenius12 Dec