Thread overview
Release of std.io v0.3.0
Jul 28, 2020
Per Nordlöw
Jul 28, 2020
Per Nordlöw
Jul 31, 2020
WebFreak001
Aug 04, 2020
Dejan Lekic
July 26, 2020
I have released a minor improvement to std.io [1], which adds support for opening the standard handles (stdin, stdout, stderr) [2].

In order to make this work, I also had to add a feature to IOs that allows you to temporarily use a file descriptor/handle [3].

As of now, it hasn't updated on code.dlang.org, but it should be soon.

With this, I'm going to focus next on making an iopipe/io layer that can replace write[f]ln and friends.

-Steve

[1] https://code.dlang.org/packages/io
[2] https://martinnowak.github.io/io/std/io/driver.html
[3] https://martinnowak.github.io/io/std/io/file/File.this.html
July 28, 2020
On Sunday, 26 July 2020 at 17:09:07 UTC, Steven Schveighoffer wrote:
> -Steve
>
> [1] https://code.dlang.org/packages/io
> [2] https://martinnowak.github.io/io/std/io/driver.html
> [3] https://martinnowak.github.io/io/std/io/file/File.this.html

Thanks.

Be free to copy what you like from

https://github.com/nordlow/phobos-next/blob/master/src/nxt/zio.d
July 28, 2020
On 7/28/20 10:08 AM, Per Nordlöw wrote:
> 
> Be free to copy what you like from
> 
> https://github.com/nordlow/phobos-next/blob/master/src/nxt/zio.d

Thanks. I actually have zip support in iopipe (it requires buffering anyway): http://schveiguy.github.io/iopipe/iopipe/zip.html

std.io is very low level -- it does not buffer, but instead provides a base framework on which to build higher level i/o abstractions.

-Steve
July 28, 2020
On Tuesday, 28 July 2020 at 18:23:45 UTC, Steven Schveighoffer wrote:
> On 7/28/20 10:08 AM, Per Nordlöw wrote:
>> 
>> Be free to copy what you like from
>> 
>> https://github.com/nordlow/phobos-next/blob/master/src/nxt/zio.d
>
> Thanks. I actually have zip support in iopipe (it requires buffering anyway): http://schveiguy.github.io/iopipe/iopipe/zip.html
>
> std.io is very low level -- it does not buffer, but instead provides a base framework on which to build higher level i/o abstractions.
>
> -Steve

Note that this is for range-based decoding of gzip, bzip2 files. With blocked decoding underneath.
July 31, 2020
On Sunday, 26 July 2020 at 17:09:07 UTC, Steven Schveighoffer wrote:
> I have released a minor improvement to std.io [1], which adds support for opening the standard handles (stdin, stdout, stderr) [2].
>
> In order to make this work, I also had to add a feature to IOs that allows you to temporarily use a file descriptor/handle [3].
>
> As of now, it hasn't updated on code.dlang.org, but it should be soon.
>
> With this, I'm going to focus next on making an iopipe/io layer that can replace write[f]ln and friends.
>
> -Steve
>
> [1] https://code.dlang.org/packages/io
> [2] https://martinnowak.github.io/io/std/io/driver.html
> [3] https://martinnowak.github.io/io/std/io/file/File.this.html

very cool, will this replace std.stdio? Will there be an API similar to the old one for upgrading?

I know on Windows low level Console output is very different from File output, is a console API in scope for std.io or would that rather be a new module? It could also handle code page setup and console mode and stuff there.
July 31, 2020
On 7/31/20 5:20 AM, WebFreak001 wrote:
> On Sunday, 26 July 2020 at 17:09:07 UTC, Steven Schveighoffer wrote:
>> I have released a minor improvement to std.io [1], which adds support for opening the standard handles (stdin, stdout, stderr) [2].
>>
>> In order to make this work, I also had to add a feature to IOs that allows you to temporarily use a file descriptor/handle [3].
>>
>> As of now, it hasn't updated on code.dlang.org, but it should be soon.
>>
>> With this, I'm going to focus next on making an iopipe/io layer that can replace write[f]ln and friends.
>>
>>
>> [1] https://code.dlang.org/packages/io
>> [2] https://martinnowak.github.io/io/std/io/driver.html
>> [3] https://martinnowak.github.io/io/std/io/file/File.this.html
> 
> very cool, will this replace std.stdio? Will there be an API similar to the old one for upgrading?

I should clarify that when I say "replace" I mean become a viable choice to replace usage in user code. I don't think Phobos will move away from its current design.

The hope is that it's written well enough that it could be the basis for low-level i/o in D 3rd party projects. For example, I'd love to see projects like vibe.d and hunt fit together on the same i/o subsystem. Then you can pick whichever library you want, or use multiple libraries, and they all work together with the same i/o framework.

std.stdio is a one-stop-shop for one specific i/o implementation (C's FILE * i/o). I don't know if there's a way to replace it. I have thought of it in the past, and the issues are hairy.

> I know on Windows low level Console output is very different from File output, is a console API in scope for std.io or would that rather be a new module? It could also handle code page setup and console mode and stuff there.

Doing console programming might fit in this library, but there is nothing there yet. If you have ideas, please start a github issue on it.

I still need to add pipes, and unix sockets.

-Steve
August 04, 2020
On Sunday, 26 July 2020 at 17:09:07 UTC, Steven Schveighoffer wrote:
> I have released a minor improvement to std.io [1], which adds support for opening the standard handles (stdin, stdout, stderr) [2].

I always hoped, since the stream package has been deprecated, that std.io will get merged into Phobos. Is that ever going to happen?