Modify access privileges of a file modified by another user

Hi there,

I am developping under Runtime Revolution to run applications on a small mix network (PCs and Macs). Common files (serving as database) are accessed from standalone application running either on PCs or on Macs.
My problem is that when a Windows (beaaark) user access a common file, it takes possession of the file, changing the access privileges, and Mac users cannot access the file anymore since the file owner became the PC owner name and the read/write privileges become “none”… whatever we do.

I am thus trying to run a AS script in order to recover the original access privileges (owner and permissions)… but I get an error message since the owner has changed and it seems that I cannot change the owner from Appelscript…
The “set owner of… to…” returns a error message “You don’t have enough privilieges bla bla bla.”
Of course I can do it by hand in the “Info” window, but it does not serve le good…

Any idea ??

JPL

Would using the command line help?

do shell script "chmod 775 filename"

You may need to use "chown" too, I'm not sure

You’ll need to be in the same directory that the file is in.

Jean-Paul, this may help for single files, you may need to add a repeat loop for a batch of files…

on open {anAlias}
	set mypath to quoted form of POSIX path of anAlias
	set uName to do shell script "whoami"
	do shell script "chown " & uName & space & mypath & ";chmod 775 " & mypath with administrator privileges
end open

Save it as an application and drop your file on it…

Greggo,

Your suggestions just worked fine… chmod and chown just did their work.
And in addition, it forces me to go a bit more into Unix that I did not want to touch, so it’s just perfect.

Thanks very much

Jean-Paul