I cannot for the life of me, get the exportlegends.lua to work properly on linux. It exports everything properly right up until we get to legends_plus xml in which it gets an error, saying simply "exportlegends: Could not move into the save folder." I'm guessing its something involving the feature of moving the legends into a folder instead of just plopping it in the dwarf fortress directory. I wish I could give more of an error report, but this is all I get when I export legends:
[DFHack]# exportlegends info
Writing all files in: legends-region1-00150-01-01
Exporting: World map/gen info
Exporting: Legends xml
Exporting: Extra legends_plus xml
exportlegends: Could not move into the save folder.
My best guess is that this has something to do with permissions - can you run these two commands?
:lua print(dfhack.getDFPath())
:lua print(dfhack.filesystem.chdir(dfhack.getDFPath()))
The first should print the path to DF - you don't have to include its output if it contains anything personal, but try creating a file in that folder and see if you're able to.
The second should print either "true" or "false", and I'd like to know what it says.
The strange thing is that the code that's failing in this case has
already run once, before the "Exporting: World map/gen info" message, so I'm not sure why it would fail when run a second time.
Some other things to check would be whether you can create a new file in the "legends-region1-00150-01-01" folder, and whether you have any free disk space on whatever disk that folder is on.
You can also pass a directory as the second argument to exportlegends, so as a possible workaround, "exportlegends info ." should avoid changing directories at all. I'd still be interested in getting to the bottom of this, if you don't mind. I've been testing on Linux and have yet to reproduce this issue (with either "info" or "custom").