September 18, 2007
You already know more than I do... even after a while trying to google on the topic.  What would be the right forum to even ask questions like that?

Sean Kelly wrote:
> For what it's worth, flush() merely writes all data buffered by Tango to the underlying device.  On non-Win32 platforms, there is no actual kernel call performed to force an immediate flush of the data to wherever.  Is it possible that OSX does buffering within the kernel and the data is lingering in there?  And if so, do you know of a routine that could be called to perform a hard flush?  Typically, the commit() method is used for this purpose, but it's empty on Posix systems right now.
> 
> Jason House wrote:
>> Given that enabling a flush doesn't solve the problem, what is the path forward for figuring out how to fix this?  It works on all other systems tested with dmd, but doesn't work on mac (with gdc).  (I've had big problems getting gdc and tango to play nicely with each other in a cygwin environment, but that's probably another thread)
>>
>> Jason House Wrote:
>>
>>> Sadly, this simple fix isn't the solution.  Here's what I got back (via e-mail)...
>>>
>>>> This part is likely your problem: "It does real time communication in
>>>> plain text with a 3rd party controlling application"
>>>> That probably means the output is redirected and not sent to an actual
>>>> console, right?
>>>> The default behavior for Stdout is to auto-flush only if the output is
>>>> sent to an actual console (i.e. isn't redirected).
>>> Well, it is sent to an actual console. I mean I just start housebot
>>> by hand
>>> and interact with it.
>>>
>>>> To make sure flushing occurs, execute "Stdout.flush = true;" somewhere
>>>> at the start of your program (main(), a static this(), or just right
>>>> before the first output).
>>> I tried that. I added the import for tango.io.Stdout to housebot.d
>>> and added
>>> "Stdout.flush = true;" at the beginning of main(), just after the
>>> variable
>>> declarations. But nothing changed.
>>
September 19, 2007
Jason,

This is trivial to test, if you'd be prepared to do that? switch to the tango examples dir, and then the console dir (examples/console/)

Compile hello.d

execute it

What happens?
September 19, 2007
kris wrote:
> Jason,

I guess it's easier if I start answering instead of having Jason relay messages.

> This is trivial to test, if you'd be prepared to do that? switch to the tango examples dir, and then the console dir (examples/console/)
> 
> Compile hello.d

That didn't quite work for me, with all the include and library files, so I instead did a "dsss build" in the examples directory.

> execute it
> 
> What happens?

u@koala:~/Programmieren/D/tango/example/console$ ./hello
hello, sweetheart ☺
u@koala:~/Programmieren/D/tango/example/console$

Is that what should happen?


Urban
September 19, 2007
Urban Hafner wrote:
> kris wrote:
>> Jason,
> 
> I guess it's easier if I start answering instead of having Jason relay messages.
> 
>> This is trivial to test, if you'd be prepared to do that? switch to the tango examples dir, and then the console dir (examples/console/)
>>
>> Compile hello.d
> 
> That didn't quite work for me, with all the include and library files, so I instead did a "dsss build" in the examples directory.
> 
>> execute it
>>
>> What happens?
> 
> u@koala:~/Programmieren/D/tango/example/console$ ./hello
> hello, sweetheart ☺
> u@koala:~/Programmieren/D/tango/example/console$
> 
> Is that what should happen?
> 
> 
> Urban

If I understand things correctly, Urban does see program output once the program exits...  He just doesn't see any while it's running.  When I look at Hello.d, it looks like it prints and then exits... potentially hiding this particular problem.
September 20, 2007
Urban Hafner wrote:
> kris wrote:
>> Jason,
> 
> I guess it's easier if I start answering instead of having Jason relay messages.
> 
>> This is trivial to test, if you'd be prepared to do that? switch to the tango examples dir, and then the console dir (examples/console/)
>>
>> Compile hello.d
> 
> That didn't quite work for me, with all the include and library files, so I instead did a "dsss build" in the examples directory.
> 
>> execute it
>>
>> What happens?
> 
> u@koala:~/Programmieren/D/tango/example/console$ ./hello
> hello, sweetheart ☺
> u@koala:~/Programmieren/D/tango/example/console$
> 
> Is that what should happen?
> 
> 
> Urban


Yes, that's exactly what should happen :)

September 20, 2007
Jason House wrote:

> 
> If I understand things correctly, Urban does see program output once the program exits...  He just doesn't see any while it's running.  When I look at Hello.d, it looks like it prints and then exits... potentially hiding this particular problem.


Well, the code does exactly the same thing when running or exiting. All the happens at exit is a flush() call on Stdout, just in case the user hadn't done one already (courtesy of Frits).

This, Any flush() should operate just fine. If the example had done nothing, it would have been more suspicious
1 2
Next ›   Last »