ID:1867917
 
Not a bug
BYOND Version:507
Operating System:Windows 7 Ultimate
Web Browser:Chrome 43.0.2357.81
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
var/savefile/F = new("house.sav") will save normally if there is no savefile found. But when caliing var/savefile/F = new("house.sav") when the file already exists it will not overwrite the save and will not do anything.

Code Snippet (if applicable) to Reproduce Problem:
mob/proc
save()
var/savefile/F = new("test.sav")
F["N"] << src.test

load()
if(fexists("test.sav"))
var/savefile/F = new("test.sav")
F["N"] >> src.test

mob
var/test = 0
verb/Roll_Dice()
src.test = "[rand(1, 99999)]"
src.save()
usr << "[src.test]!!!"
Login()
..()
src.load()
usr << "Saved info [src.test]."


Expected Results:
Should save over the last savefiles stats.

Actual Results:
Loads the very first stats it saved.

Does the problem occur:
Every time? Or how often?
So far every time.
In other games?
Not sure.
On other computers?
Not sure.

When does the problem NOT occur?
Not sure I just took notice when I was coding and testing a house system I made.

Workarounds:
Just call fdel("test.sav") before it saves.
Not deleting the savefile is intended behavior. new/savefile(name) can be used to load a savefile, not just to create one.

Except if I read you right, you're saying that the stat isn't changing at all. That definitely shouldn't be happening.

If you use a savefile editor, what does it show you? Also, is there any chance the savefile is being locked or write-protected?
Ah I did not know that, all righty!
I jused changed this "var/savefile/F = new("test.sav")" to "var/savefile/F = new/savefile("test.sav")" It seems to be saving properly now.
I think our responses crossed paths, as originally I misread the issue as simply that the savefile wasn't being deleted on new()--which it shouldn't be. I edited with more info.
Strange. Including the type path shouldn't be necessary. I wonder if you had some kind of a fluke situation before where the file permissions were wrong.
That was weird, it works the other way around now, I honestly have no idea why it was doing that and my dream maker was just acting up and would not let me save or copy paste even after nothing was being compiled. Calling "var/savefile/F = new/savefile("test.sav")" just fixed it.

[edit]
No idea man, it saves info the first time but when calling save again it just did not want to save new stats over the old ones. Its possible something locked up but hard to put my finger on what just happend.
Couldn't copy/paste? Interesting. You wouldn't happen to be using Webroot security software, would you? People who use that have had issues with copying and pasting.
I don't use webroot software and just checked my computer for anything suspicious. Couldn't find anything using task manager and ms config. I'll keep you posted if anything else weird happens cause it seems the compiler is compiling and running the codes wrong. I'll look more into the problem cause it's possible it could be just me, I'll run an older version and see what happens.
Nadrew resolved issue (Not a bug)