On 9/9/2013 1:27 PM, Edward K. Ream wrote:
On Tue, Sep 3, 2013 at 8:23 AM, Jacob Peck <[email protected]
<mailto:[email protected]>> wrote:
Just a curious question. I could always rely on the filesystem to
mark a file read-only, but I'm just wondering if there's a
mechanism within Leo to mark a file as read-only?
A curious question, indeed.
Why would you want to do that? You would run the risk of losing
whatever changes you made to the outline.
Well, to put it simply, to prevent changes to an outline. For example,
documentation for a project that I don't want changed. Or to recast Leo
as a (admittedly glorified) book reader.
Not truly important, just a question that popped up in my brainspace
while thinking about LeOS stuff.
I've come to the conclusion that really that kind of thing is up to the
OS level anyway.
That does bring me to another point for LeOS though - in order to modify
/etc/leoConfig.leo, or other system-protected files, I'd need to somehow
get superuser privileges into a running Leo instance... or perhaps just
spawn a second copy of the Qt GUI running as root? Eh, thoughts for
another day...
Thanks for the hint,
-->Jake
If you must, you could use os.chmod. See
http://docs.python.org/2/library/os.html
Note the following comment::
QQQ
Although Windows supports chmod(), you can only set the file’s
read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD
constants or a corresponding integer value). All other bits are ignored.
QQQ
Edward
--
You received this message because you are subscribed to the Google
Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/groups/opt_out.