live code seems to gratuitously unlock write permission for directories
alex at tweedly.net
Sat Dec 3 12:47:52 EST 2016
OK, I got slightly lost in this thread - we've gone off to solve a
work-around to your problem, and I'd like to go back to the problem itself.
If I understood it properly, what you;re seeing is that setting the
permission of a directory to disallow write *should* prevent you from
saving a stack within that directory - but it doesn't.
So I decided to write a small test stack that did just that, and see how
it performs. And it does just what I would expect (which I think is the
same as you would expect :-)
I know it's unhelpful, even annoying, to be told "it works OK for me" -
but it works ok for me.
Could I ask you to download my simple stack, and try it out in your
environment - ideally on the same directory - and report back on what it
does ? Hopefully this will isolate whether it's your
OS/filesystem/environment or something else going on in your scrips.
It's at http://tweedly.org/downloads/checkpermissionsettings.livecode
very simple stack - 4 buttons
- one let's you specify a directory
- one checks the permission of that directory and write that to the
- one removes write permission on the specified folder
- the last one adds write permisison.
I actually saved this stack within the folder so I was testing something
as close as possible to what I thought was your situation.
So you should find that after specifying the folder, you can check the
permissions, save the stack, remove write permission, check permissions
(and see that it's gone), then try to save the stack again - and it
fails. Then add wrote permission back again, chek permissions and then
save - works OK.
On 02/12/2016 20:34, Dr. Hawkins wrote:
> I've added the following after setting the name, and also moved the save
> into this block:
> *if* (char 1 to 6 of bkNm) <> (char -17 to -12 of the long name of this
> stack) *then*
> *--date has changed*
> bmpVrsn stkNm
> *save* this stack
> *end* *if*
> bmpVrsn is my routine to bump the filename. Without this, it would keep
> backing up yesterday's file . . .
More information about the Use-livecode