 |
 |
How could this be done?
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
I would like to create a folder where certain users could write files to, they could view them from there, but could not modify them afterward.
Could this be done with some kind of scripting maybe? What would solve this?
Thanks,
t
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
I haven't tried this with Mac OS X, but you could create a directory with the permissions that you want the files to have, and then turn on the "set-UID bit" (using the terminal), which will make sure that all files written to that directory would have the same owner as the directory itself.
Then (using chmod) set the permissions differently for the owner (eg, read-write-excecute) and other users (eg, read-excecute).
Would this do what you want?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status:
Offline
|
|
Another way would be to have two folder--one a read only folder, and one a dropbox. Write a folder action Applescript to watch the dropbox and move all files that are dropped into it to the read only folder.
Chris
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
So would they be able to write to the directory?
t
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Aug 2002
Status:
Offline
|
|
Just so I'm clear you want user A to be able to create a new file in the directory. Once the file is created then user A should only be allowed to read the file?
Or should user A have full rights to any file user A creates while users B-Z should only be able to read it?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Oct 1999
Status:
Offline
|
|
get a .Mac account. That is exactly what I use mine for.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
Originally posted by dharknes:
Just so I'm clear you want user A to be able to create a new file in the directory. Once the file is created then user A should only be allowed to read the file?
Or should user A have full rights to any file user A creates while users B-Z should only be able to read it?
The first one.
Someone mentioned the sticky bit. How does one turn on the sticky bit? And do I have to turn it on for the folder containing these files?
Thanks,
t
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Jun 1999
Location: Las Vegas, NV, USA
Status:
Offline
|
|
get a .Mac account. That is exactly what I use mine for.
How does .Mac help?
Chris
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
Does anyone know how to create a folder action script that would change the permissions of the files written into it to a specific kind?
So the folder would be "world readable, writable", and then once the files are in the folder their permissions would get changed so that only I could r,w,x...and the other user creating the files could only read.
Thanks,
t
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
You want to set the umask to 000, then once the file is there, do a chown to your user, and do chmod go-wx on the file.
You could do this via a shell script that runs on cron, or you could have the apple event fire off the shell script. Find files that have not been modified in at least a minute, and do the above to them.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
Originally posted by Arkham_c:
You want to set the umask to 000, then once the file is there, do a chown to your user, and do chmod go-wx on the file.
You could do this via a shell script that runs on cron, or you could have the apple event fire off the shell script. Find files that have not been modified in at least a minute, and do the above to them.
Alright I am really not an expert on cron....
or AppleScript...
I know I am being a pain in the butt, but could someone actually write this code down please? I am not sure how to go about it. I have been to some AppleScripting sites but they were not much of a help.
Thank you,
t
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
I bet this could be done easily with Folder Actions (look in the Applescript folder in your Applications folder)
I haven't played around with it much yet, but it looks like you'd just need to write an Applescript that changes the permissions appropriately, and then attach that script to the folder you are sharing - the act of copying an item into the folder should activate the script which would change the permissions for that item.
Somebody should be able to tell you how to write a simple permission-changing Applescript...
|
|
cpac
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2000
Location: Tempe, AZ
Status:
Offline
|
|
Originally posted by cpac:
I bet this could be done easily with Folder Actions (look in the Applescript folder in your Applications folder)
I haven't played around with it much yet, but it looks like you'd just need to write an Applescript that changes the permissions appropriately, and then attach that script to the folder you are sharing - the act of copying an item into the folder should activate the script which would change the permissions for that item.
Somebody should be able to tell you how to write a simple permission-changing Applescript...
Does anyone know how to write a permission changing apple script?
Thanks you,
t
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2001
Location: New York, NY
Status:
Offline
|
|
I'm no applescript guru, but just looking briefly at the Finder's dictionary, it looks like something like this might work:
--------
tell Finder
make owner cpac
make everyones privileges read only
end tell
--------
you might have to add in code to make sure the script runs on the appropriate items in the folder (again, somebody with more experience would know better)
you might also want to create a new topic as the current topic is not descriptive, and certainly doesn't let the AppleScript gurus out there know you need help.
|
|
cpac
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|