I will need to do some testing.  Here is an example of fopen using a named
pipe

   mkfifo fifoname

 /* issue fopen for write end of the fifo                     */
        wr_stream = fopen(fifoname,"w");

from:  
http://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.cbcpx01/fifopip.htm

The "wb" your listing has add the "b" but based on what I have found
the "b"  adds nothing and is the same as just "w."  The documentation
I found states it is only added for ISO C standard conformance.

I will need to do some more testing and report back.


On Sat, Dec 31, 2016 at 3:32 PM, Richard Hipp <d...@sqlite.org> wrote:

> On 12/31/16, Paul Lambert <eb30...@gmail.com> wrote:
> > I have observed that the file write mode of this function when using the
> > same file name a second time will delete the previous data in the file.
> > This is most likely accomplished by deleting the file and recreating a
> new
> > one.  if so then this explains why the .output function locks up when
> using
> > a named pipe as the pipe is not responding to a delete command.
>
> It just calls fopen().  http://www.sqlite.org/src/
> artifact/6095531aa9?ln=2609
>
> I don't know what fopen() is doing behind the scenes.  Probably it
> works differently on different systems, but I would have guessed that
> it just invoked open() with O_TRUNC.
>
>
> >
> > Pipes are files and the ability to launch an application and place a
> > pending read on the pipe is such that the system will block the read and
> > the application will hang on the read statement until something shows up.
> > In the case of a file this is not true.
> >
> > I believe this command needs to be modified so that it performs a "stat"
> to
> > determine if the target is a file or named pipe.  If a named pipe then
> omit
> > the call to delete it.  This function should additionally check to make
> > sure the target is a file and not a directory too as user typos will most
> > certainly lead to unknown results.
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
> --
> D. Richard Hipp
> d...@sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to