Newbie Secure Question
[1/2] from: kpeters::vu-ware::com at: 9-Aug-2005 21:47
Hmm - what's up here? The help doesn't help....
>> mydir: %/c/kai/
== %/c/kai/
>> secure [ file quit mydir [ allow read ]]
** Script Error: Invalid argument: mydir
** Near: secure [file quit mydir [allow read]]
Using a literal value works?!?
>> secure [ file quit %/c/kai/ [ allow read ]]
== [net allow library ask shell ask file quit %/C/rebol/d [allow read
quit write quit execute]]
What is this newbie missing?
Thanks, as always, for all the help!
Kai
[2/2] from: Izkata:Comcast at: 10-Aug-2005 0:04
>> mydir: %/c/kai/
== %/c/kai/
>> X: [ file quit mydir [ allow read ]]
== [file quit mydir [allow read]]
>> type? X/3
== word! ;<-- here
>> X: [ file quit %/c/kai/ [ allow read ]]
== [file quit %/c/kai/ [allow read]]
>> type? X/3
== file! ;<-- here
Here is how I would do it if I needed to use a word instead of
a literal value:
>> X: compose [ file quit (mydir) [ allow read ]]
== [file quit %/c/kai/ [allow read]]
>> secure :X ;<-- note the colon
== [net allow library allow shell allow file allow]
The colon tells it to use the block that X represents, not X itself,
or you'd get an error.