|
From: Tatsuro M. <tma...@ya...> - 2008-02-23 06:29:27
|
Hi
I previuosly wrote the mail.
At that time, I think that pgnuplot did not have relation to the matters.
However the pgnuplot have relation to the matter.
This is because the stdin of windows is the windows specific text mode.
I made a code the following the diff results.
The log results attached as 'temp.dat'
Addition of
_setmode(fileno(stdin), _O_BINARY);
is the most essential change. Other changes are only for taking the log.
If you have any suggestion to me, please make a reply.
Regards
Tatsuro
**************************************************************
*** pgnuplot.org.c Sat Apr 8 23:22:48 2006
--- pgnuplota.c Sat Feb 23 14:58:00 2008
***************
*** 223,235 ****
LPTSTR psCmdLine;
BOOL bSuccess;
BOOL bPersist = FALSE;
! int i;
!
#if !defined(_O_BINARY) && defined(O_BINARY)
# define _O_BINARY O_BINARY
# define _setmode setmode /* this is for BC4.5 ... */
#endif
! _setmode(fileno(stdout), _O_BINARY);
for (i = 1; i < argc; i++) {
if (!argv[i])
--- 223,235 ----
LPTSTR psCmdLine;
BOOL bSuccess;
BOOL bPersist = FALSE;
! int i; FILE *fp;
!
#if !defined(_O_BINARY) && defined(O_BINARY)
# define _O_BINARY O_BINARY
# define _setmode setmode /* this is for BC4.5 ... */
#endif
! _setmode(fileno(stdout), _O_BINARY); _setmode(fileno(stdin), _O_BINARY);
for (i = 1; i < argc; i++) {
if (!argv[i])
***************
*** 340,348 ****
/* wait for commands on stdin, and pass them on to the wgnuplot text
* window */
! while (fgets(psBuffer, BUFFER_SIZE, stdin) != NULL) {
PostString(hwndText, psBuffer);
}
/* exit gracefully, unless -persist is requested */
if (!bPersist) {
--- 340,352 ----
/* wait for commands on stdin, and pass them on to the wgnuplot text
* window */
! while (fgets(psBuffer, BUFFER_SIZE, stdin) != NULL) {
! fp=fopen("temp.txt", "ab");
PostString(hwndText, psBuffer);
+ fputs(psBuffer, fp);
+ fclose(fp);
}
+
/* exit gracefully, unless -persist is requested */
if (!bPersist) {
--- Tatsuro MATSUOKA <tma...@ya...> wrote:
> Hi
>
> In the help of the wgnuplot, Plot-data-BINARY DATA FILES:
>
> General binary data can be entered at the command line via the special file name '-'. However,
> this
> is intended for use through a pipe where programs can exchange binary data, not for keyboards.
>
> However this could not be done for pgnuplot+wgnuplot.
> I sent the data from the octave via pipe to pgnuplot.
> The pgnuplot merely sends data a byte by a byte using win32 api to wgnuplot.
> So this phenomenon comes from wgnuplot.
>
> see the snapshot : wgplt080204.png at
> http://www.geocities.jp/tmgpltwin/Files/Files.htm
>
> After wgnuplot stopped, it cannot accept code nor keybord anymore.
>
> If this is the limitation of wgnuplot, please rewrite the help of the above for the wgnuplot.
>
> Environment
> wgnuplot 4.2.2 on winXP(personal)
>
> Regards
>
> Tatsuro
>
>
>
> --------------------------------------
> Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
> http://pr.mail.yahoo.co.jp/toolbar/
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/ |