Thread overview
Duplicate data between std.c.stdio and core.sys.posix.fcntl
Jun 19, 2013
bioinfornatics
Jun 19, 2013
Jonathan M Davis
Jun 19, 2013
bioinfornatics
Jun 19, 2013
Jonathan M Davis
June 19, 2013
i think they are some duplicate data between  std.c.stdio and core.sys.posix.fcntl

Both module define
        O_RDONLY O_WRONLY, O_RDWR, O_APPEND,O_CREAT, O_TRUNC, O_EXCL

maybe std.c.stdio should to use version poix winows and whatever to load these data
June 19, 2013
On Wednesday, June 19, 2013 18:50:26 bioinfornatics wrote:
> i think they are some duplicate data between std.c.stdio and core.sys.posix.fcntl
> 
> Both module define
> O_RDONLY O_WRONLY, O_RDWR, O_APPEND,O_CREAT, O_TRUNC,
> O_EXCL
> 
> maybe std.c.stdio should to use version poix winows and whatever to load these data

Everything in std.c.* should just be publicly importing the corresponding stuff from core, and arguably, those modules should be deprecated. We moved all of that stuff to core ages ago. I'm surprised to see anything in std.c.stdio other than a public import.

- Jonathan M Davis
June 19, 2013
On Wednesday, 19 June 2013 at 17:48:49 UTC, Jonathan M Davis wrote:
> On Wednesday, June 19, 2013 18:50:26 bioinfornatics wrote:
>> i think they are some duplicate data between std.c.stdio and
>> core.sys.posix.fcntl
>> 
>> Both module define
>> O_RDONLY O_WRONLY, O_RDWR, O_APPEND,O_CREAT, O_TRUNC,
>> O_EXCL
>> 
>> maybe std.c.stdio should to use version poix winows and whatever
>> to load these data
>
> Everything in std.c.* should just be publicly importing the corresponding stuff
> from core, and arguably, those modules should be deprecated. We moved all of
> that stuff to core ages ago. I'm surprised to see anything in std.c.stdio other
> than a public import.
>
> - Jonathan M Davis

so we should to use O_RDONLY fnrom which module?
June 19, 2013
On Wednesday, June 19, 2013 22:46:59 bioinfornatics wrote:
> so we should to use O_RDONLY fnrom which module?

Well, for whatever reason, it's in core.stdc.stdio on Windows, so if you're on Windows, that's what you'd use, whereas on Posix systems, it's in core.sys.posix.fcntl. I would have _thought_ that core.stdc.* would be the same across OSes as its _standard_ C, but for whatever reason, it isn't. Regardless, there's no duplication here on any particular OS, as the definitions in core.stdc.stdio are specific to Windows, whereas the ones in core.sys.posix.fcntl are specific to Posix.

- Jonathan M Davis