[phobos] Removing std.stdio.File.popen()

Lars Tandle Kyllingstad lars at kyllingen.net
Mon Aug 16 05:45:06 PDT 2010


Further investigation shows that druntime does indeed have the LFS
declarations. :)

-Lars



On Mon, 2010-08-16 at 14:29 +0200, Lars Tandle Kyllingstad wrote:
> Though I agree with you, the fix for the popen-close bug is utterly
> simple regardless of whether FILE* is used.  The problem is that it
> requires adding more POSIX-only stuff, which I assume we wish to avoid.
> 
> 
> Speaking of std.stdio.File and FILE*, I noticed that Phobos actually
> does have buffered I/O that doesn't depend on FILE* in std.stream.  I'm
> not saying we should keep std.stream, but at least we have something we
> could build a native D implementation of std.stdio.File from.
> 
> I seem to recall someone (David?) saying it has some bugs with large
> files on Linux, but I think that's just a matter of enabling the
> kernel's LFS API.  (If I'm not mistaken, it's simply a matter of adding
> declarations to enable the kernel's LFS syscalls to druntime, along with
> a version() statement to enable or disable them.  Then, people who want
> large file support can just compile Phobos with that enabled.
> 
> Also, I think FILE* has the same problem...
> 
> -Lars
> 
> 
> 
> On Mon, 2010-08-16 at 04:38 -0700, Steve Schveighoffer wrote:
> > Yet another reason to get rid of FILE * dependency.  Any modern i/o library with 
> > opaque reference types uses methods which know how to close it.
> > 
> > -Steve
> > 
> > 
> > 
> > 
> > ----- Original Message ----
> > > From: Lars Tandle Kyllingstad <lars at kyllingen.net>
> > > To: Phobos mailing list <phobos at puremagic.com>
> > > Sent: Mon, August 16, 2010 4:11:01 AM
> > > Subject: [phobos] Removing std.stdio.File.popen()
> > > 
> > > I just noticed that std.stdio.File.popen() is POSIX-only.  Taking  that
> > > into account, along with the fact that it is buggy (issue 3157),  does
> > > anyone mind if I remove it?
> > > 
> > > It's only used once in Phobos, namely  in std.process.shell(), which is
> > > easily implemented by using  core.sys.posix.stdio.popen() together with
> > > core.sys.posix.stdio.fdopen() and  std.stdio.File.wrapFile().
> > > 
> > > -Lars
> > > 
> > > _______________________________________________
> > > phobos  mailing list
> > > phobos at puremagic.com
> > > http://lists.puremagic.com/mailman/listinfo/phobos
> > > 
> > 
> > 
> >       
> > _______________________________________________
> > phobos mailing list
> > phobos at puremagic.com
> > http://lists.puremagic.com/mailman/listinfo/phobos
> 
> 
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos




More information about the phobos mailing list