Hi Frank,
thanks for the implicit bug report.
I think that svxdir/ldxdir also work for you, but there's a small badly
documented thing:
If absdir=1, absolute folder paths are written into the XML files, which
make it impossible to correctly re-import the files with ldxdir, which
only loads the first level. ldxrec would load more levels.
On the other hand, with absdir=0 svxdir stores relative folders.
Please find the attached example which should clarify things.
best greetings,
Thomas
Acutally that is what the "svxdir/ldxdir file.xml" methods of
[originator] were supposed to handle. The approach was to have it work
like in attached example patches. For debugging purposes the commands
sent to the internal [pool] are still printed into the console.
However it doesn't work. :( Probably I'm misunderstanding how the
pool-methods svxdir/ldxdir are supposed to work. According to the
pool-help.pd they should save and load the contents of the current
directory. However what they actually do save and load is a full tree,
including the toplevel name. Until pool gets a method (or until I find
the existing method of pool) that really only saves the content of a
directory and nothing else I'm afraid there's no way to easily save
and load local states. (You could of course build your own
local-saver...)
Ciao
--
Thomas Grill
http://grrrr.org
#N canvas 531 166 841 775 12;
#X obj 140 663 print K;
#X obj 91 692 print V;
#X obj 189 637 print D;
#X text 262 637 directory (abs or rel to current);
#X text 166 693 data value;
#X text 212 663 data key;
#X obj 162 482 r $0-pool;
#X obj 288 585 print A;
#X text 360 584 attributes;
#X obj 242 611 print C;
#X text 314 611 command;
#X obj 196 584 route bang;
#X obj 401 698 print ------------;
#X text 405 678 separator on bang;
#X msg 191 208 mkchdir $1-dir;
#X obj 164 404 s $0-pool;
#X obj 140 215 until;
#X obj 140 242 random 1000;
#X msg 140 277 set $1 $1;
#X msg 60 72 reset;
#X msg 474 413 printroot;
#X msg 155 72 1 , 2 , 3 , 4 , 5;
#X obj 162 510 pool;
#X msg 476 154 absdir 0 , chdir 3-dir , svxdir test.xml;
#X obj 155 128 t b f;
#X text 59 46 1)clear;
#X text 165 49 2)populate;
#X msg 140 188 5;
#X text 479 50 3)save;
#X text 479 80 write absolute paths into file;
#X text 477 134 write relative paths into file;
#X text 474 234 only load one level of the XML file;
#X text 475 296 load all levels of the XML file;
#X msg 478 101 absdir 1 , chdir 3-dir , svxdir test.xml;
#X msg 474 257 reset , ldxdir test.xml;
#X msg 473 315 reset , ldxrec test.xml;
#X text 477 213 4)load;
#X text 475 392 5)print;
#X connect 6 0 22 0;
#X connect 11 0 12 0;
#X connect 11 1 9 0;
#X connect 14 0 15 0;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X connect 18 0 15 0;
#X connect 19 0 15 0;
#X connect 20 0 15 0;
#X connect 21 0 24 0;
#X connect 22 0 1 0;
#X connect 22 1 0 0;
#X connect 22 2 2 0;
#X connect 22 3 11 0;
#X connect 22 4 7 0;
#X connect 23 0 15 0;
#X connect 24 0 27 0;
#X connect 24 1 14 0;
#X connect 27 0 16 0;
#X connect 33 0 15 0;
#X connect 34 0 15 0;
#X connect 35 0 15 0;