[Sugar-devel] opening a can of worms: editing files from within Sugar

Walter Bender walter.bender at gmail.com
Wed Jun 8 12:47:45 EDT 2011

As some of you know, I have been working on enhancements to Sugar view
source. I have patches to enable the user to make a copy of the activity
bundle being viewed with the intention that it be modified. The question is,
how does the user modify their copy of the activity?

Of course, more advanced users will open a Terminal and use their favorite
editor (Emacs, naturally). But it would also be nice to be able to make
edits directly from Sugar.

I began modifying the Edit activity but then realized that I was opening a
can of worms:

* What happens if there is a collision?
* What happens if the file is moved or deleted?
* Does deleting the datastore instance mean we should also delete the
filesystem instance?

So what I am thinking is sticking to copy-on-write. When you open a file
from outside of Sugar, you are creating a copy, which lives in the
datastore. Only if you explicitly save that copy back to the file system
does your change impact the original file. Does that make sense? Should I
enable general writing of files from Edit into the file system or restrict
this to files opened from the file system? Or is this too dangerous or
potentially confusing to our users?


Walter Bender
Sugar Labs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110608/849ec368/attachment.html>

More information about the Sugar-devel mailing list