Discuss the massively-multiplayer home defense game.
You are not logged in.
I'm trying to look at the output redirected from this command in the text file:
nohup ./CastleDoctrineHeadless > headlessLog.txt 2>&1 &
But the text file never gets any of the prints in it?
Is the only way to see the output to run it in foreground on a terminal? Running it directly produces obvious output.
I'd expect to see something like this in the text file:
L4 | Mon Feb 24 20:09:34 2014 (801 ms) | general | Height in grid per timbre = 10
L4 | Mon Feb 24 20:09:34 2014 (801 ms) | general | Max note length in song = 3
Waiting for connection on port 5077, password = 'secret'
Got connection
Simulation took 0.013000 seconds
Offline
Gesundheit!
Offline
What I'm starting to suspect is I simply need to put an fflush() in somewhere. My guess is the output is just getting buffered up and hasn't reached the point anything cares about getting it synced to the file system.
Has anyone else running a server cared to check on the simulation output yet? I know there's at least a few people with these up and running.
Offline
What I'm starting to suspect is I simply need to put an fflush() in somewhere. My guess is the output is just getting buffered up and hasn't reached the point anything cares about getting it synced to the file system.
Has anyone else running a server cared to check on the simulation output yet? I know there's at least a few people with these up and running.
No output there. I guess it's because the application will not print out anything when there is no real terminal to output to (there are few applications working like that). That would explain why you see it in the console output, but not in the file. fflush is not gonna help IMHO as if that would be problem you wouldn't see it in the console either.
...
Offline
Mine shows output in the file, but only after quite a while, when the output becomes long enough. I think it's being buffered.
http://stackoverflow.com/questions/1393 … ed-to-file
Looks like an fflush would help (isn't that ugly, though, because printf doesn't usually need it!?)
Offline
Mine shows output in the file, but only after quite a while, when the output becomes long enough. I think it's being buffered.
http://stackoverflow.com/questions/1393 … ed-to-file
Looks like an fflush would help (isn't that ugly, though, because printf doesn't usually need it!?)
Wow. That is really strange. It's usual to have buffered output, but I've always seen it flushed after new line. Good - I learned something new :-)
...
Offline