digitalmars.D.bugs - writef bug?
- Ivan Senji (7/7) Jul 08 2004 I import std.stdio;
- Walter (3/10) Jul 08 2004 linux or windows? And is the 0.95 library installed?
- Ivan Senji (10/25) Jul 08 2004 WindowsXP, i did what i allways do: extract the new zip over
- Ivan Senji (5/20) Jul 08 2004 I tried it on the other computer and it works(sort of).
- Walter (3/26) Jul 08 2004 try an fflush(stdout) after the writef.
- Ivan Senji (5/6) Jul 08 2004 That works but that way i have to import both
- Walter (6/14) Jul 09 2004 The flush is triggered by the output of '\n' when writing to a 'tty'. I'...
-
Carlos Santander B.
(25/25)
Jul 09 2004
"Walter"
escribió en el mensaje - Walter (7/30) Jul 09 2004 I'd
- Carlos Santander B. (6/6) Jul 08 2004 I think this will be fixed when TypeInfo gets better, but right now:
I import std.stdio; and writef("Hello"); gives me: Error 42: Symbol Undefined _D3std5stdio6writefFYv when linking! And i really wanted to figure out how this writef works!
Jul 08 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cck8ng$2mk4$1 digitaldaemon.com...I import std.stdio; and writef("Hello"); gives me: Error 42: Symbol Undefined _D3std5stdio6writefFYv when linking! And i really wanted to figure out how this writef works!linux or windows? And is the 0.95 library installed?
Jul 08 2004
"Walter" <newshound digitalmars.com> wrote in message news:cckbdk$2qes$1 digitaldaemon.com..."Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cck8ng$2mk4$1 digitaldaemon.com...WindowsXP, i did what i allways do: extract the new zip over the old ones. The strange thing is that there is a _D3std5stdio6writefFYv string in phobos.lib. I just tried deleting my dm and dmd directories, an re-extracted the zip, and now it compiles and links, but when i run it i get "Test.exe is not a valid Win32 executable" It may be that i am a little tired and doing something wrong, i'll try it on the other computer tomorow! :)I import std.stdio; and writef("Hello"); gives me: Error 42: Symbol Undefined _D3std5stdio6writefFYv when linking! And i really wanted to figure out how this writef works!linux or windows? And is the 0.95 library installed?
Jul 08 2004
"Walter" <newshound digitalmars.com> wrote in message news:cckbdk$2qes$1 digitaldaemon.com..."Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cck8ng$2mk4$1 digitaldaemon.com...I tried it on the other computer and it works(sort of). writefln does work ok writef doesn't print anything with the same arguments!I import std.stdio; and writef("Hello"); gives me: Error 42: Symbol Undefined _D3std5stdio6writefFYv when linking! And i really wanted to figure out how this writef works!linux or windows? And is the 0.95 library installed?
Jul 08 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cckk6p$602$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in message news:cckbdk$2qes$1 digitaldaemon.com...try an fflush(stdout) after the writef."Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cck8ng$2mk4$1 digitaldaemon.com...I tried it on the other computer and it works(sort of). writefln does work ok writef doesn't print anything with the same arguments!I import std.stdio; and writef("Hello"); gives me: Error 42: Symbol Undefined _D3std5stdio6writefFYv when linking! And i really wanted to figure out how this writef works!linux or windows? And is the 0.95 library installed?
Jul 08 2004
"Walter" <newshound digitalmars.com> wrote in message news:ccl6v8$10k9$1 digitaldaemon.com...try an fflush(stdout) after the writef.That works but that way i have to import both std.c.stdio and std.stdio! I think i'll just stick with the writefln (it is really nice by the way!)
Jul 08 2004
"Ivan Senji" <ivan.senji public.srce.hr> wrote in message news:cclcok$1919$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in message news:ccl6v8$10k9$1 digitaldaemon.com...The flush is triggered by the output of '\n' when writing to a 'tty'. I'd just remembered that <g>, which is why the writefln worked for you. The output from writef will eventually appear. In fact, the behavior is the same as if you used a printf without a '\n'.try an fflush(stdout) after the writef.That works but that way i have to import both std.c.stdio and std.stdio! I think i'll just stick with the writefln (it is really nice by the way!)
Jul 09 2004
"Walter" <newshound digitalmars.com> escribió en el mensaje news:ccmgfa$2usm$3 digitaldaemon.com | The flush is triggered by the output of '\n' when writing to a 'tty'. I'd | just remembered that <g>, which is why the writefln worked for you. The | output from writef will eventually appear. In fact, the behavior is the same | as if you used a printf without a '\n'. What about this? ////////// import std.date; import std.stdio; import std.c.stdio; void main () { writefln("hi"); fflush(stdout); d_time t = getUTCtime (); while ( getUTCtime() - t < 2 ) {} writef("bye"); } ////////// Both "hi" and "bye" get printed at the same time (2 secs after the program started). Tested on WinXP Pro and Win95 (yes, I'm currently using also 95). ----------------------- Carlos Santander Bernal
Jul 09 2004
"Carlos Santander B." <carlos8294 msn.com> wrote in message news:ccn4oq$rbi$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> escribió en el mensaje news:ccmgfa$2usm$3 digitaldaemon.com | The flush is triggered by the output of '\n' when writing to a 'tty'.I'd| just remembered that <g>, which is why the writefln worked for you. The | output from writef will eventually appear. In fact, the behavior is the same | as if you used a printf without a '\n'. What about this? ////////// import std.date; import std.stdio; import std.c.stdio; void main () { writefln("hi"); fflush(stdout); d_time t = getUTCtime (); while ( getUTCtime() - t < 2 ) {} writef("bye"); } ////////// Both "hi" and "bye" get printed at the same time (2 secs after the program started). Tested on WinXP Pro and Win95 (yes, I'm currently using also95). Windows is a multithreaded operating system, and while your program is hung in a tight loop, it is probably preventing other threads from running, like the thread that updates the console window.
Jul 09 2004
I think this will be fixed when TypeInfo gets better, but right now: date_t t = /* something */; writef("%s",t); Outputs the numeric representation of the date. ----------------------- Carlos Santander Bernal
Jul 08 2004