lDE$D437xD0P022h=<%hIv 2222h2A f0t0@߰7D FH dL !"#$%&'()*+,-./0123456789<hEFPL@`vQRvUVWXYZ[\]vd<d<yd,ww #share& workspace #1 fileaid& > share K;' K share ;,' the function #share& is used to manage the access matrix of a file in the vm aplPplus shared file system. the default :empty" access matrix gives full implicit access to the file owner and no access to any other user. by setting the file access matrix, selected privileges can be granted to selected users. the file operations that are controlled by the file access matrix are J read J tie :exclusive tie" J erase J append J replace J drop J rename J hold J rdci J rdac J stac J status #share& is an interactive function that aids in constructing and interpreting file access matrices. it prompts for a command with K>> K. commands are entered as free_form sequences of user numbers, keywords, file passnumbers, and the names of file privileges being manipulated. more than one command can be entered at once by using K`K or K share KsampleK KsampleK tied to 1. >> show no rows found. >> 1234567, 2345678, read rdci >> show user access 1234567 read, rdci 2345678 read, rdci >> 98765 1234567 all but erase, pass 928423 >> show user pass access 98765 928423 all but erase 1234567 928423 all but erase 1234567 0 read, rdci 2345678 0 read, rdci >> set access matrix set. #share& is also used to modify an existing access matrix> share 1 K7654321 sampleK tied to 1 >> delete 98765 ` show user pass access 1234567 928423 all but erase 1234567 0 read, rdci 2345678 0 read, rdci >> delete 1234567 pass 928423 rename rdac stac >> show ` set user pass access 1234567 928423 read, tie, append, replace, drop, rdci, hold, status 1234567 0 read, rdci 2345678 0 read, rdci access matrix set. descriptions of the commands that are recognized follow. fields in brackets are optional. represents zero or more user numbers< represents the names of one or more file operations :read, append, replace, etc."< represents a file passnumber. ;pass ' grant the given to the listed , optionally requiring that they specify the passnumber . all but ;pass ' grant full privileges to the listed , except for the given , optionally requiring the passnumber . show ;' ;' ;pass ' display the present working copy of the access matrix. the optional field restricts the display only to the stated users< restricts it only to users having the stated access privileges, and pass further qualifies the display. delete ;' ;' ;pass ' delete one or more rows from the access matrix, as identified by and . or, if , is specified, remove those privileges from the rows identified by and . add ;' ;' ;pass ' extend the privileges of the listed with specified to include the given . if is not specified, the privileges are granted to all users. set set the access matrix. the access matrix is not actually changed until this command is issued. quit exit from #share&, leaving the access matrix in its original form. stop same as #quit&. the syntax accepted for commands is quite flexible and considerable variation in the form of these commands will be accepted. if in doubt about the effect of a command, use #show& before using #set&. #share& is adapted from a function originally written by john c. gilmore. t7 "       !"#$%&'() *!+",$-&.'/(0)1*2+3-4.5/617283948X copyright 1981, stsc,inc. written by jcg< modified by jgw 21may81$X,\Kaccess matrix unchanged.K,( stop>]::Ra"-Rnums"Rnoop(]loop(noro>Kno rows found.K(]errD`l22>KPPP an add command must include access codes.KD,|]loop put the bits in.[@,$l21>m;pass<2'[2Bb(a$xKaccess:es" already exist for K,:m;:(b)a"/pass<1'",K.K some of the prople already have this access.x8]:(/,b)a[::31R2"Na"J.(pass*pass"Ul21 80b[:31R2"Nm;pass[pass/IRpass<2'0 l20>]:R,a"Ul22 (pass[pass)m;<1'Enums( ]:Rnums"Ul20 0add>pass[:0%Rpass"(m;<3'Epass 04L]loop delete the specified rows.4m[:Tpass"m$l19>]:(/pass"Unoro $<D]loop blot out the specified access bits.< m;pass<2'[2Bb&a 8]:(/,b)a[::31R2"Na"J.(pass*pass"Unoro80b[:31R2"Nm;pass[pass/IRpass<2',0  @9l18>]:R,a"Ul199 ( @9pass[pass)m;<1'Enums' ( ]:Rnums"Ul18, 0dele>pass[:0%Rpass"(m;<3'Epass0]l16d Rl17>pass[KnoneK L]l14 nums[1Unums$b[ 1 0 Ub l16>b;1<',pass 4pass[pass,2U,:commandvalsEa"pmat40l15>a[::31R2"Na"/2P:I31"_I100Hpass[KallK,:=a[@1_a"/K but K0,\]:0 1 %=a[KKRnums"/l17,l15,pass[KK$Ƽl14>]:Rnums"Uloop$$nums[, 0 1 0 /nums0$<Db[:1U,K,li,zi2K Lfmt a" Lfmt 1 0 1 /nums<4da[:(a*0"=6S2-S:a#0"-D10Ma-a%040l13>]:0ERa[ 1 0 1 /nums"Rnoro0l 00nums[:(::31R2"Na":31R2"N, 0 1 0 /nums"nums keep those with any of the same accesses. 0l]:R,a"Ul13Dl12>nums[::m;<1'Enums")::0%Rpass"(m;<3'Epass""mD$show>]:Rnums"Rl12$]0(Kaccess matrix set.K( m[:m;<2'*0"m  m[m;m;<1'<' (set>]::Ra"-Rnums"Rnoop(<l11>]:1 2 3 4 5 %b"/set,show,dele,stop,addR<]inp:$KPPP ignored> K,md$$err>]:0%Rmd"/inp#$0noop>KPPP no operands allowed.K0D]loop:<\m[:nums,a,;0.5-I1':Rnums"R1Ypass",;I1' mD<]err4KPPP no user numbers specified.K4 l9>]:Rnums"Rl10 ]err4KPPP no access codes specified.Kt4]err0tKPPP multiple actions invalid.K0(]:0 1 %Rb"/nocmd,l11"$(, a[::Ra"U0"R:@1P(/a#0"=-/MaR,t]errDxKPPP invalid commandK,::1*-/Tb"/KsK",K> K,,:Tb"cmdD,]:)/b[(/a[cmd).%cmdmat"Rl8<,Hcmd[:cmd(.*Kbut K" 0 @2 U:-/cmd;< 1 2'EKLfK"cmd&H(cmd[::1RRcmd",7"Ycmd!((l7>nums[Lfi,K K,numsha(\]err:HKPPP illegal usernumberK,::1*-/Ta"/KsK",K> K,:Ta"numsH(d]:)/a[Lvi,K K,nums"Rl7(`cmd[:ab"cmd get passnumber< remove those rows from input matrix. `$l6>pass[Lfi pass$d]errm0KPPP invalid passnumber> K,pass0$Ll5>]:Lvi pass"Rl6 $T]errm0l4>]:Rpass[,:b[0,@1Ua"cmd"Rl5d0D]:0 1 %-/a[:::1RRcmd",5"Ycmd").%Kpass K"/nopass,l4,D0L]:0ERcmd[K ,./K vim cmd"Rloop0$md[:1-Rcmd"Umd$,cmd[::D/mdIK<`K"_I1"Ymd0,dTKKKK,::0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 (a*K K"/a",KKK tied to K,1YxYd]0]l30 0 RLdef:Kz[d vim i00 on 1 january 1900. r _ twenty_four_element character vector containing the date and time in the form> mm/dd/yy hh>mm>ss>xxxxxx . . filehelperKX@ given a numeric scalar which represents a date and time in 21may81X t[ftimebase Lts (md[:(?TmdEK> K"/md(@ represents milliseconds, notmicroseconds."@\fie filehelper for unix apl system llg 20 apr 84 \ a[::aIa"%IRa"/a @l10>m[:T(/m;< 1 3').%nums,;0.5':I0"R1Ypass"m@,r;1< 1 2 3'[1r;1< 1 2 3',$r;1<1'[100Mr;1<1'$r[a-6939028a[D:a_d[86400000000Ma"+86400000000 8 dr[r-:r_c"+36524 $$]:0*1RRLlibs"R1-Llc$$b[:=b"_=c[36524Mra$@b[D:a*Da"/aa[:a%Da"/a l3>m[Lfrdac x 0KKKK,:,a",KKK tied to K,x[qt x0H0 0 RLdef K r[qt x]:0%Rmd"/inpY$ Lerase KaK A.d[ 0 60 60 Ndt xa[Da+1000,,d[D:d_a[1000000Md"+1000000,Lerase KbK@ Lerase Ka cK'@ <1dp h H x tx \ <   L(r[,Ki2,2:#/&,zi2",# &,2:zi2,#>&",zi2,#.&,zi3,#000&K Lfmt rL@l8>a[:(a"/commandvals, 1.1 2.1 3.1 4.1 4.1 5.1@Hb[r_ 0 @2 29 57 88 118 149 179 210 241 271 302 332;c'-bH r[time t00 on 1 january 1900, this functionL384PXcotd[ 0 0 0 0 0 0 1 /-?a=:Ra"R 0 0 0 3600000000 60000000 1000000 1000 9_LiX dr[:7*@1YRa"RKK r[timen t<nopass>nums[:a[cmd;<1'EK0123456789@K"cmd< b[b-=c[1461Mr ,`r[r_:r_b[146097Mr"+146097,\ rKold seek addr of access matrix K, seek[Lnread n,4 1 40 ' \xh<[:( @P.ffhis access.xd prior to display< the last 3 characters in the result are always 0.dd K1YxYd\Lnu:tn,K.sfK"Lntie n s\  t[tscur this function encodes the current date and time :Lts" into microseconds from 00>00 on 1 january 1900. t _ numeric scalar encoding of Lts. im,KPPP K,:x",K not tied.K,dcmdmat[:::1RRcmdmat",5"Ycmdmat",;I1' 6 5 RKset show deletstop quit add Kdxshare xLnuntie n \\z[ rank R Lnread n,4,:=/rank",seek - 24 \\rank [ Lnread n,4 2,seek - 16 \ t t[tstamp r this function encodes a date and time value into microseconds from 00>00 on 1 january 1900. it is inverse to the function #timen& in workspace #1 fileaid&. r _ seven_element numeric vector containing a date and time in the form> four_digit year, month, day, hour, minute, second, and microsecond. t _ numeric scalar date and time value in microseconds from 00>00 on 1 january 1900. 0.   r[timen t this function formats date and time values in microseconds :as produced by the third element returned by the function Lfrdci". t _ numeric scalar date and time value in microseconds from 00>00 on 1 january 1900. r _ seven_element numeric vector containing the date and time in the form> four_digit year, month, day, hour, minute, second, and microsecond. .pass[I0,r[ftimerep a mm/dd/yy hh>mm>ss>xxx000H8@::1Ra"YKuserK",::1Ua"YKpassK",KaccessK8t[tscur( EJKLMN (|<l'p''&|lLct[Lio[0 x]:0%1Y0Ra[x"Rl1 ,xpmat[K,K,K K,:Rcmdmat"Ra,,Ll2>a[,Lfnames;LfnumsI1Rx<', x ;$inp>[K>> K cmd[:Ta"cmdD L returns a seven_element numeric vector representing thatLX given a six_ or seven_element numeric vector representing a date1X$ 1 january 1900.$T 00 that date and time in microseconds from 00>00 on 1 january 1900.pT ;4T milliseconds, not microseconds.4T8 date and time in the form> yyyy, mm, dd, hh, mm, ss, xxxxxx .TL[txtLio[1deL microseconds from 00>00 on 1 january 1900, this functionL4Tr[:::Rt",6"Yftimerep t",1000000Mt4Lio[1nums[m;<1' \P given a numeric scalar which represents a date and time inlways 0. K\md[at""syntax error tstamp ) 1 january 1900. ;4' note however that the result is accurate only to milliseconds ;5' because it is based on Lts, the last element of which is ;6' milliseconds, not microseconds. ;7' t[ftimebase Lts G T<end &,l&D(4$&tuterrorH,41z [ 0 xHH and time in the form> yyyy, mm, dd, hh, ss, xxxxxx0HidomainzOtimehow(timenhowADtscurhowA tstamphowB<\Kold access matrixK \\]:0 % seek"/exit no access matrix \\:1YLai"Lnreplace n,8 make caller the owner \\Kold owner of file K, Lnread n,4 1 8 \\G [:1Y0 2" Lnreplace n, 40 remove access matrix 20 \0  #cI"/extd1($    t   `  t  Lts. im8 r[filehelper n this function is used to regain access to a file. filehelper is useful if the access matrix of a file has been altered in such a way that the owner has lost the necessary accesses. it can also be used to reset access on a file which has been created via unix cp or mv commands. filehelper resets the access matrix to empty and changes the file owner to the current user number. it returns the existing access matrix as a result. note> space occupied by the access matrix will remain occupied though unused after filehelper. if this space is significant, use Lfdup to copy the file and recover the space. n _ character vector file name of shared file to be altered. r _ n = 3 integer access matrix as it was before filehelper was applied. 8describeio[$sharehowLtcm Lfstac xamIdAcrmftimebase b tstampr[tstamp ttscurP this function returns a floating_point scalar representingdsPrhwtimen$ r[ftimebase 7Yt L because it is based on Lts, the last element of which isLX8 note however that the result is accurate only to millisecondsys 0.XT this function returns a floating_point scalar representing .TLȇ the current date and time in microseconds from 00>00 onL$n[ D/@1-@1,Lnnumsti$Xadt note that the result is really only accurate to milliseconds becauseXttimestopnoroDl22l21l20addl19l18delel17l16l15l14l13l12showsetl11errnoopl10l9nocmdl8l7nopassl6l5l4loopinpl3l2l1txtqtvimcommandvalscommandspvecP, pmatRcmdmatmdpass(nums .mcmd,xshare(l1>]::1Rx"ELfnums"Rl2( x ;i<K<nl,K  (-( h( L   ftimerep L returns a 24_element character vector representing thatPL\pcommandvals[ @1 1 2 4 8 16 32 128 512 1024 2048 4096 8192 163840 0 1 0 0 0 \tcommands[Kall read tie erase append replace drop rename rdci resize hold rdac stac dupKt$0 0 RLdef K G r[txtK,Ltcnl,K;1' r[KKpossible options are>KK,LtcnlK,Ltcnl,K;2' r[r,KK ; pass 'KK,LtcnlK,Ltcnl,K;3' r[r,KK all but ; pass 'KK,LtcnlK,Ltcnl,K;4' r[r,KK show ; ' ; ' ; pass 'KK,LtcnlK,Ltcnl,K;5' r[r,KK delete ; ' ; ' ; pass 'KK,LtcnlK,Ltcnl,K;6' r[r,KK add ; ' ; ' ; pass 'KK,LtcnlK,Ltcnl,K;7' r[r,KK setKK,Ltcnl,KK quitKK,Ltcnl,KK stopKKK,Ltcnl,K GK,Ltcnl,KK$( `**((a;:aEK K"/IRa'[Ltcdel($]:K K(.*md"Rloop<$\owe removes access matrix, sets owner to caller< returns old access matrix ow\,a[,cmdmat[K K vim commands,Lct[Lio[0dcostsc nocmd>]:Ra"Rl9  @ z[ eseLdm0 9co md te020%%`%x%%%-,,,,,h,P,<,$, +++++++l+X+D+0++*******p*\*D*0#**))) ) )))x)`.)L)8)$)((+(,(((- (& &,%$%$ %@D>@  ( (D,%) 9h!,@,1T! x d8 P; << $   5.#4$4:   @$dPDEhPNVF 9B<P+8`4Y8]dF567-K/023; ELJM':G?<N&8* HI =!"ABOC4D