I have double and triple checked the spelling, copypasted it from other addons where it's working. Checked and rechecked I have the proper ## SavedVariables Line in my .txt and still, the addon I'm writing simply does not even create the file. (I even removed the whole SavedVars folder and let the game to recreate it in case of some writing issue. It did it beatifully for each and every other addon). I'm running out of ideas.
I have it in the EVENT ADDON LOADED , which is the way it works in other addons I have done. I even took one trial to create it later via chat command to see if it was too early in addon loaded. I'll have to re-recheck the folder naming when I get home. I was also thinking, could it be issue of wrong kind of line endings in the .txt. Also the function seems to work otherwise since a table it returns works further in the code, without causing nil accessing problems.. The file just doesn't get created.
I recreated the .txt file from the beginning, and now it works. The only difference I seem to have is that now there is linebreak in the end of the file, while earlier it ended in the line that contained the .lua file to be loaded... No idea if that was the problem, or if there was some thing else mystically broken.