1
2
Nov 28 2008, 12:13 pm
In response to CIB
|
|
-_-' You're accessing the save via ExportText *after* the directory already changed....
|
In response to CIB
|
|
Ok. That "../" was wrong, it should just be "..".
|
In response to Xooxer
|
|
Xooxer wrote:
... Your posts thus far have made it pretty clear that your tests are not correct, because you're expecting them to return something they won't, because you're not seeing that the current directory is the directory you just saved, and that the default path argument is the current directory. Er, whatever. The savefile's cd variable is changed when you saved the list. Now, look. I'm not changing the cd variable anywhere. I'm assigning a list to the top-path, which is the cd at the same time. If I was changing the cd variable, all the other lists would be saved under the new cd. But they are all saved under the top-directory. Changing the order of saving should have no effect here on the savefile itself. Thing is, it does. Whichever list gets saved first, it will be written to the top-directory. All other lists will be written to the proper fields. You never mentioned any bugs without the ExportText() calls. First I didn't because the ExportText result was surprising me. Anyway, I did this: World["create"] << null Result: . = null Come to think of it, it would be possible that the first field would always create a new directory and all data would get written to it. That way I would sort of have a recursive, ever-growing save-file.. Doesn't sound good, I'll better check it out. |
In response to CIB
|
|
CIB wrote:
Now, look. I'm not changing the cd variable anywhere. No, you look. Saving it changes the current directory. The act of saving in this manner:
World["GMList"] << GMList
Causes the savefile to go to the top-level, create new directory called "GMList", then insert all the items in it. The current directory "." is "GMList" right after this happens. I'm assigning a list to the top-path, which is the cd at the same time. If I was changing the cd variable, all the other lists would be saved under the new cd. But they are all saved under the top-directory. Not true. Sving it that way causes it to save to the *exact* path you put in the quotes. Since you're not doing "GMList/MyOtherList", it's not making sub directories. All the lists are top-level directories because yo never told it to save any other way. Thing is, it does. Whichever list gets saved first, it will be written to the top-directory. No, it's written to the directory you tell it to. "." is not the top-level directory, it is the current directory. All other lists will be written to the proper fields. All lists re written properly. It's your test which is wrong. Anyway, I did this: > World["create"] << null Result: > . = null That's right. |
In response to CIB
|
|
Nope, it seems to be remaining the same, ".." will return just the same result as "/", even if the fiels are changed and the file-size remains the same, too.
|
In response to CIB
|
|
I quit. I can not help you.
Read the reference on all the variables and procs relating to savefiles. That's all I can say. |
In response to Xooxer
|
|
OK, if it is right and you understand it well, explain me this:
1. I assign GMList the last. Why isn't the cd changed to GMList? 2. Without the null fix, why does it get written to "." and not "GMList" which remains a separate field with an unchanged value and which is used to load the data from in World["GMList"]? 3. If I change my current working directory to something non-top-level, why are the top-level entries still displayed? 4. Why |
In response to CIB
|
|
CIB wrote:
1. I assign GMList the last. Why isn't the cd changed to GMList? Order of directories is not preserved, as it states in the reference. Really. Go read it. 2. Without the null fix, why does it get written to "." and not "GMList" which remains a separate field with an unchanged value and which is used to load the data from in World["GMList"]? "." is *not* a directory. 3. If I change my current working directory to something non-top-level, why are the top-level entries still displayed? Probably because you are really confused bout what you're seeing, so I suggest you go read the reference a bit more. 4. Why Because knowing is half the battle! |
In response to Xooxer
|
|
The problem's solved, yet I do not understand why it is behaving like that. I have read the documentation on savefiles, but it isn't revealing anything new to me, it's rather conflicting with what I'm experiencing.
|
In response to CIB
|
|
Like what? From what I can tell, it's doing exactly what you're telling it to. The odd behavior isn't in the saving system. It's in your debug. If you *fixed* that with some hack, you may have just broken your saving system. o_o You really really need to make sure your tests check out first.
|
In response to Xooxer
|
|
Xooxer wrote:
"." is *not* a directory. so I suggest you go read the reference a bit more. Quote from reference: The path "." stands for the current directory Sorry, but I don't get how . is not a directory while at the same time standing for a directory. |
In response to Xooxer
|
|
Behaviour before my weird fix: GMList would just remain the same, saves would not apply to it, restarting the world would clear everything stored in "." and set the GMs back to what was in "GMList".
Behaviour after my weird fix: GMLists are saved properly and load properly. |
In response to CIB
|
|
It's a variable, or a command, depending on how you want to look at it. "." is literally "here", or "this". ".." is "up" or "parent".
|
In response to CIB
|
|
Can you make a small demo of that? I don't get your problem.
|
In response to Xooxer
|
|
Yes, so "." refers to the current working directory. So, if the current working directory is not the top-level directory(atleast you say so), it shouldn't display the contents of the top-level directory.
|
In response to Xooxer
|
|
So, you're saying something like this isn't saving properly for you?
var |
In response to CIB
|
|
Here. Try this and see if it makes any sense. Just compile it into a new project, run it twice (once to initialize the savefile, the second to do a full save and load from the savefile), then open the log.txt file it creates.
world |
1
2