std.file, std.stdio(File), std.stream(File:Stream)
Jonathan M Davis
jmdavisProg at gmx.com
Wed May 16 20:37:08 PDT 2012
On Tuesday, May 15, 2012 09:48:23 H. S. Teoh wrote:
> On Tue, May 15, 2012 at 07:47:24PM +0400, Dmitry Olshansky wrote:
> > On 15.05.2012 19:32, H. S. Teoh wrote:
> > >On Tue, May 15, 2012 at 05:14:15PM +0200, ref2401 wrote:
> > >>general question:
> > >>-std.file,
> > >
> > >std.file is badly named. It really deals with the _filesystem_, that is,
> > >pathnames, etc.. It doesn't deal with individual files.
> >
> > Bleh, std.file.read does just that - reads entire file into memory.
> > In essence std.file works with filesystem and files, and unit of
> > work is a file.
>
> [...]
>
> OK, that is totally deserving of a WAT. The split between std.file,
> std.stdio, std.stream, etc., are just soooo illogical. I'm hoping that
> std.io will eventually clear up this crazy mess, but I suspect std.file
> will still remain. Is there any logical reason why we shouldn't rename
> it to std.filesystem or std.fs? Calling it std.file is needlessly
> confusing, esp. given that most of the functions actually concerned with
> file I/O are in std.stdio (or the future std.io).
std.file operates on files. I don't see anything wrong with it. Most of it isn't
I/O though (aside from read and write which operate on the whole file at once).
The I/O stuff is in std.stdio. I really don't think that the current separation
is a problem. std.stdio definitely needs some work (hence the future std.io),
but I think that std.file is fine as-is. Renaming it would break code to no
benefit IMHO.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list