stackfiles
Richard Gaskin
ambassador at fourthworld.com
Fri Aug 10 11:45:30 EDT 2018
Bob Sneidar wrote:
>> On Aug 9, 2018, at 15:51 , Richard Gaskin wrote:
>>
>> Besides, even if you had two stacks whose stackFiles had the same
>> stack short name assigned to different stackFiles, one of them
>> wouldn't work anyway because as soon as it tried you'd get a stack
>> name conflict warning.
>
> I tested this. You don't get a conflict warning if the second stack
> attempts to open it's version of "splash" after the first stack had
> opened it's version. Instead, when the first stack has it's version of
> "splash" already opened, and the second stack tries to open it's
> "splash", LC simply goes to the "splash" the first stack already has
> open.
Any confusion there is just clumsy writing on my part. When I wrote
"wouldn't work anyway" I meant that if it did what you had originally
expected the stack name conflict would be the outcome.
As implemented, the stack name conflict is avoided because the
stackFiles assignments first brought into use take precedence over
anything later that would contradict them.
> So as I posted earlier, the only way to get around this, if you were
> so unwise as to have 2 versions of a stackfile floating around, would
> be to get the line of the stackfiles property for the stackfile you
> want to open, then use the full path, which is item 2 of the line. But
> then if the OTHER version of the stack file is open, THEN you would
> get the conflict.
Exactly. Stack names being global, any "solution" to this won't be much
of a solution at all, since the end result would be a stack name conflict.
Finding a true solution would depend on *why* you're working on multiple
stacks with the same name.
If it's to compare something with an older version, or copy something
from an older version into a new one, running the older version in a
second instance of LC is simple enough if you can spare a gig and a half
of disk space. That gives you a completely separate namespace and
requires no special effort beyond copying your LC folder.
Diffing can be done cleanly and efficiently by reducing each stack to an
array and then comparing the arrays. Converting a stack to LSON is a
relatively short script, and once on disk the LSON files have no
namespace restrictions so they can be easily manipulated within a single
LC instance however one likes.
And if you use script-only stacks you have the choice of opening them as
stacks or textual data, so working with two stacks as text is super easy
and requires no special handling, and can even be done in any text editor.
There are also the possibility of automating versioned saves with
appended stack names that include a unique time stamp, and many other
options.
Which of the many options is best for your circumstance will depend on
the "why".
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list