www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Release of std.io v0.3.0

reply Steven Schveighoffer <schveiguy gmail.com> writes:
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
Jul 26 2020
next sibling parent reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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
Jul 28 2020
parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
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
Jul 28 2020
parent Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
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.
Jul 28 2020
prev sibling next sibling parent reply WebFreak001 <d.forum webfreak.org> writes:
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.
Jul 31 2020
parent Steven Schveighoffer <schveiguy gmail.com> writes:
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
Jul 31 2020
prev sibling parent Dejan Lekic <dejan.lekic gmail.com> writes:
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?
Aug 04 2020