List: Internals « Previous MessageNext Message » From: Michael Widenius Date: December 5 2000 12:06am Subject: mysql-3.23.28 NT, binary files opened as read-only View as plain text
```Hi!

>>>>> "Roger" == Roger Larsson <larssoro@stripped> writes:

Roger> Hi,
Roger> I've noticed taht as of 3.23.28 all binary files are created as
Roger> read-only under Windows NT. The problem is the call to open()
Roger> under NT, if O_CREAT is specified, the third parameter (pmode) to
Roger> open() is mandatory. If the file does already exist, the parameter is
Roger> ignored. I assume it is not intentional to create the files as
Roger> read-only.

Roger> I suggest the patch below.

Roger> Best regards,
Roger> /Roger Larsson

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

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

<cut>

Applied; Thanks!

Regards,
Monty
```
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
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9867626428604126, "perplexity": 19709.843186940492}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-15/segments/1397609539066.13/warc/CC-MAIN-20140416005219-00535-ip-10-147-4-33.ec2.internal.warc.gz"}