Home > Community > Forums > Custom IC SKILL > how to findout the permission of a library.

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 how to findout the permission of a library. 

Last post Fri, Jun 27 2014 10:13 AM by Andrew Beckett. 3 replies.
Started by howardhaoracle 30 Sep 2013 10:28 PM. Topic has 3 replies and 750 views
Page 1 of 1 (4 items)
Sort Posts:
  • Mon, Sep 30 2013 10:28 PM

    how to findout the permission of a library. Reply

    Hi..

    Is there a skill code that I can use to find out the permission of a library instead of clicking on the property button on a library to find out??

    Example: When I use the GUI from the lib browser, I am able to find out the permission of a library whether it has write or read permission. My question is is there a Skill code that I can use to find that out instead of clicking on the library's property?

     Thanks in advance for your help

    Howard

    • Post Points: 20
  • Tue, Oct 1 2013 12:01 AM

    • berndfi
    • Top 100 Contributor
    • Joined on Tue, Sep 11 2012
    • Neubiberg, Bavaria
    • Posts 67
    • Points 1,255
    Re: how to findout the permission of a library. Reply
    Several methods, one of the should fit to your needs.

    ddGetObj( "myLib" )~>ownerAccess
    ddGetObj( "myLib" )~>groupAccess

    resp.
    ddGetObjAccess( ddGetObj("myLib") "owner" )

    or 
    ddGetObj("myLib")~>isReadable
    ddGetObj("myLib")~>isWriteable

    resp.
    isReadable( ddGetObjReadPath( ddGetObj( "myLib" ) ) ) 
    isWritable( ddGetObjWritePath( ddGetObj( "myLib" ) ) ) 
                           
    • Post Points: 20
  • Fri, Jun 27 2014 10:09 AM

    • dfick
    • Not Ranked
    • Joined on Sun, Mar 14 2010
    • Ann Arbor, MI
    • Posts 11
    • Points 115
    Re: how to findout the permission of a library. Reply

     These didn't work for me for some reason, so i found that I had to manually check:

                     ; Manually check access since Virtuoso seems to get it wrong sometimes
                    myCmd = sprintf(nil "/usr/bin/stat -c%%A %s/%s.oa", ddGetObjWritePath(obj), obj->name)
                    textresult=runCmd(myCmd)

                    rexCompile("w")
                    is_writable = rexExecute(textresult)

     

     Where runCmd is defined as:

     

     procedure(runCmd( myCmd )
      printf("Executing %s\n" myCmd);
      myCid = ipcBeginProcess(myCmd)
      ipcWait(myCid)
     
      textresult=""
      while( outputResult=ipcReadProcess(myCid)
         textresult=strcat(textresult, outputResult)
      ) ; while
      rexCompile("%")
      textresult = rexReplace(textresult, "%%", 0)
      printf(textresult)
      printf("\n")
      returnval=textresult
    )

     

     

     

    • Post Points: 20
  • Fri, Jun 27 2014 10:13 AM

    Re: how to findout the permission of a library. Reply

    I can't see why those wouldn't work, unless for some reason you're on some strange filesystem maybe. You should contact customer support.

    Andrew.

    • Post Points: 5
Page 1 of 1 (4 items)
Sort Posts:
Started by howardhaoracle at 30 Sep 2013 10:28 PM. Topic has 3 replies.