Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Log help

Log help

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 

Posted by Garaelb   (54 posts)  Bio
Date Reply #15 on Thu 24 Jul 2003 04:51 AM (UTC)
Message
Arsen are you on a win 98 system or NT?
Top

Posted by Arsen   (44 posts)  Bio
Date Reply #16 on Thu 24 Jul 2003 05:11 AM (UTC)
Message
NT
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #17 on Thu 24 Jul 2003 05:17 AM (UTC)
Message
correct me PLEASE if I am wrong here.

Quote:
stdin, stdout, and stderr are simply file pointers, and can be redirected on
dos or unix. there is nothing magic about them that prevents redirection. the
fact that the shell (sh or csh on unix, command.com on dos) does not do this
for you does not prohibit you from doing it yourself. below is the code to a
simple shell which redirects any of these file pointers before executing an
arbitrary command. "redirect -i myin -o myout -e myerr foo arg1 arg2" will
execute the dos command "foo arg1 arg2" with stdin redirected from file myin,
and stdout and stderr redirected to files myout and myerr, respectively. so
information is not lost, myout and myerr are opened for appending, rather
than overwriting. this works on dos or unix.

/*
** redirect -- feed line to shell with stdin/stdout/stderr redirected
**
** usage -- redirect [-i newin] [-o newout] [-e newerr] command
**
** executes command via the shell, but redirects stdin/stdout/stderr first.
** stdout/stderr are appended, not overwritten.
*/



so on my win98SE system
if I type from a dos prompt

C:\redirect -e c:\smaug\log\smauglog.txt

My log files will start working as they are suppose to?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #18 on Thu 24 Jul 2003 05:22 AM (UTC)
Message
Judging by their help, what you actually need to do is tell it *what* to redirect, like this:


redirect -e c:\smaug\log\smauglog.txt smaug.exe

You didn't have the command on the end.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #19 on Thu 24 Jul 2003 05:36 AM (UTC)
Message
well we seem to be making progress. I now have a file in the log subdir called smauglog.txt

When I opened it it had one line in it
"Bad Command or File Name"

Argh!

That was after typing in from the dos prompt
C:smaug\redirect> redirect -e c:\smaug\log\smauglog.txt smaug.exe

it seem sadding the smaug.exe was important to making the file, but now what actually goes in there?

Will I need to type that in each time I start the game?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #20 on Thu 24 Jul 2003 10:22 AM (UTC)
Message
"sadding"?

Naturally you need to type the command in the directory where the command actually is, or have it in your path. So, you probably need to do something like this:

c:
cd \smaug
c:\redirect\redirect.exe -e c:\smaug\log\smauglog.txt smaug.exe

You don't have to type that in every time, put it in a batch file.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Garaelb   (54 posts)  Bio
Date Reply #21 on Thu 24 Jul 2003 04:02 PM (UTC)
Message
sadding was a typo of "seems adding".

on the otherhand I now have a SMAUGLOG.txt file.

And I can now actually see all the little eight-legged freaks running around in the code. naturally you know this means there are going to be more questions later on the nature of these horrible little creatures ;-) But for now I'm jumping in my seat with glee as this is working now. As we say in the game HUZZAH NICK!!!

;-)

Thanks much

~G~
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


55,386 views.

This is page 2, subject is 2 pages long:  [Previous page]  1  2 

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.