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.
 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Pfiles will not save when running Smaug in Windows.

Pfiles will not save when running Smaug in Windows.

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


Posted by Dace K   Canada  (169 posts)  Bio
Date Tue 06 Jul 2004 05:20 AM (UTC)

Amended on Thu 08 Jul 2004 12:02 AM (UTC) by Dace K

Message
I have this problem every time I start a new mud, and every time I forget how to fix it..

I spent a few minutes looking around here, yet did not find much advice besides "make a backup directory".

So I had to sit down and figure it out; decided to post it here in case it'll help people with this problem in the future.


When you save in smaug, it saves to a tmpfile, then overwrites the original pfile to cut down on pfile bugs.
Unfortunately, Windows does not allow this..so you have to add a line of code deleting the original pfile first.

Open up save.c, and search for

if (ferr)
{
perror(strsave);
bug("Error writing temp file for %s -- not copying", strsave);
}
else
rename(TEMP_FILE, strsave);
}

replace it with

if (ferr)
{
perror(strsave);
bug("Error writing temp file for %s -- not copying", strsave);
}
else
{
remove(strsave);
rename(TEMP_FILE, strsave);
}}

That should fix all problems with pfile saving and the delete/destroy commands.

Cheers!

~S.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Wed 07 Jul 2004 03:25 AM (UTC)
Message
Heh, that should solve many peoples problems. The only issue is that the main reason people get Smaug Windows is because they don't want to code/don't know how. If thats the case, they probably don't have a compiler, like Cygwin.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #2 on Thu 08 Jul 2004 12:06 AM (UTC)
Message
Aye, but this problem happens with Cygwin as well :|.
It's because windows doesn't let you rename a file to the same name as an existing file.

..apparently this doesn't fix the bug with destroy/delete, I'll look into that when I get home.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #3 on Thu 08 Jul 2004 02:48 AM (UTC)
Message
Actually, running smaugfuss in cygwin, I do not have any kind of problem with pfiles not saving. What version are you using?

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #4 on Thu 08 Jul 2004 03:59 AM (UTC)
Message
SmaugFUSS should work fine with Cygwin if the makefile flag is on. But I think Satsui is talking about normal Smaug.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Gatewaysysop2   USA  (146 posts)  Bio
Date Reply #5 on Sat 10 Jul 2004 09:58 AM (UTC)
Message
Strange. I will have to second Greven on the Smaug FUSS not having this problem under Windows, either 95, 98 or 98SE from what I can tell. I also believe I ran several other versions / flavors of SMAUG (including the one offered here, or at least at one time) and it worked fine too.

Weird.

"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence
Top

Posted by Dace K   Canada  (169 posts)  Bio
Date Reply #6 on Mon 12 Jul 2004 01:49 AM (UTC)
Message
:\. I'm talking about smaug 1.4a from www.smaug.org.

Turns out the bug was that backup dir is defined as ../player/backup in mud.h, whereas the actual backup folder is located at ../backup.

Smaug1.4a is such a heap of bugs :\.

ASJ Games - .Dimension 2, Resident Evil, and snippets - oh my!
http://asj.mudmagic.com

Drop by the area archives and find something for your mud. http://areaarchives.servegame.com
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Mon 12 Jul 2004 02:30 AM (UTC)
Message
You mean the smaug.org that no longer exists? Heh, yeah. Its gone. Not sure why.

Didn't know that it was a backup issue.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #8 on Mon 12 Jul 2004 11:12 AM (UTC)
Message
No, I'm sure he meant the smaug.org which is still reachable at www.game.org/smaug :P

And yes. The "official" version of the codebase is rittled with bugs, hence the need for the FUSS package which has more or less plugged them. At least those poeple know about and have reported somewhere. I myself have never had a problem saving pfiles in Windows, but then that was well after I had fixed that backup dir problem in my code.
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.


22,073 views.

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.