Skip to main content
1-Visitor
January 24, 2012
Question

ACL to get Editor startup command arguments

  • January 24, 2012
  • 3 replies
  • 907 views
Inside ACL code I'd like to see if the Editor session was started as
read-only. I can see whether the specific documents are read-only using
the doc_read_only() function, but it will return 0 (not read-only) for a
given doc when Editor was started with the -r switch (session read-only)
and that doc had doc_read_only(doc, 0) called on it, even though the
session state seems to take precedence.

I can't seem to find anything in ACL or in the API for other languages
like Java that indicates whether Editor was started as read-only. I also
looked for something that would return the command line string that
started Editor so I could search for "-r" in that string, but I can't
seem to find anything like that, either. Any ideas?

Thanks,
--



Brian Jensen
bjensen@bluelid.com

    3 replies

    1-Visitor
    January 24, 2012
    The option() function allows a second argument to indicate that you want
    the session-level value for an option, but so far as I can tell, there is
    no option corresponding to the read-only status. Your best bet may be to
    rely on the fact that every document starts out read-only in this state and
    to do something like use doc_add_callback() to set up a document "create"
    callback that will fire whenever a document is opened to check its state or
    use doc_open() to briefly open some arbitrary file without the read-only
    flag and see if it is read-only anyway. Doing the latter just once after
    startup shouldn't be too inefficient.

    -Brandon 🙂


    BrianJ1-VisitorAuthor
    1-Visitor
    January 25, 2012




    Brian Jensen
    bjensen@bluelid.com


    BrianJ1-VisitorAuthor
    1-Visitor
    January 25, 2012
    Brandon,

    Thanks for the idea, I'll give that a try.

    Sorry, everyone, for the empty reply a few minutes ago. Had the reply
    window open ready to write this, got called away for a few minutes, then
    came back and absentmindedly hit the send button.

    Regards,



    Brian Jensen
    bjensen@bluelid.com