[gdal-dev] Wrapping VSIStdoutSetRedirection

Ari Jolma ari.jolma at gmail.com
Tue Nov 10 10:13:43 PST 2015


Maybe because I'm an idiot. :)
Too long coding today.
10.11.2015 19.42 "Even Rouault" <even.rouault at spatialys.com> kirjoitti:

> Le mardi 10 novembre 2015 18:22:19, Ari Jolma a écrit :
> > I'd like to wrap VSIStdoutSetRedirection.
> >
> > I would use it for streaming generated data in a web environment. The
> > preferred way to stream data out nowadays in Perl web development is to
> > use a write function in Perl space - i.e., not the standard print to
> > stdout.
> >
> > I can capture stdout and achieve the wanted goal that way but it is a
> > bit too hackish I think.
> >
> > I don't think the wrapping is such a big deal itself - it will require a
> > bit unusual function typemap, so I'll limit it to Perl for now - but
> > there is something in the C space I need to ask.
> >
> > How can one undo a redirection done with VSIStdoutSetRedirection? It
> > seems to me that it would need a function:
> >
> > void VSIStdoutUnsetRedirection()
> > {
> >      pWriteFunction = fwrite;
> >      pWriteStream = stdout;
> > }
> >
> > but there is no such. Should there be one?
>
> Why not just call VSIStdoutSetRedirection(fwrite, stdout) ?
>
> >
> > Best,
> >
> > Ari
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151110/d443b29d/attachment.html>


More information about the gdal-dev mailing list