# Setting OSX File Permissions



## Tacocaster (Jul 10, 2003)

Good morning,

I've been transferring files from my linux machine to my MBP via a Samba connection, and it seems that as each file is transferred, it is defaulted to Read Only. I understand by bringing up the info pane of each file I can change the permissions, but I'd like to know how to do this for multiple files at the same time. I'm willing to learn how to use Automator (I don't know how to use Automator at the moment, but willing to learn) for this, but I'm looking for a simpler solution. Any ideas?

Thank you for your time.


----------



## Yankee Rose (Jul 14, 1999)

Hello:

Copy all the files to their respective folder first, then right click on the folder and choose the permissions settings you want. Next select "Apply to enclosed items" (right next to the + - buttons) and it will apply the settings to all of the files within the folder.

Hope that helps!


----------



## Tacocaster (Jul 10, 2003)

Fantastic! Thank you very much!


----------



## billiehawkins (May 5, 2010)

If you want an automatic fix, OS X has 'folder actions.' If you often copy files to the same folder, you can attach an applescript to the folder as an action, and anytime you add a file or folder to it, it will execute the folder script. 

For example: 

Make an applescript (open Script Editor and paste this in the window), and save it to ~/Library/Scripts/Folder Action Scripts/ChangePermission.scpt

on adding folder items to this_folder after receiving added_items
tell application "Finder"
set fold_name to the name of this_folder
try
repeat with i from 1 to number of items in added_items
set new_item to item i of added_items
set the item_path to the quoted form of the POSIX path of new_item
do shell script ("/bin/chmod -R +r " & item_path)
end repeat
end try
end tell
end adding folder items to

Then, Make another applescript and save it to ~/Library/Scripts/Folder Action Scripts/ChangePermissionSubfolder.scpt also. 


on opening folder this_folder
tell application "Finder"
set script_file to ((path to library folder from user domain as Unicode text) ¬
& "Scripts:Folder Action Scripts:add - Make world-readable.scpt" as Unicode text)
repeat with each_folder in (get every folder of this_folder)
tell application "System Events"
attach action to (each_folder as alias) using (script_file as alias)
end tell
end repeat
end tell
end opening folder

Then, on the folder you are copying things to: 
Right-click on the folder, and choose 'Folder Actions Setup' and choose the Applescripts you have created.


----------



## GowerIT (May 6, 2010)

Or you could do it the hardcore way from the command line 


Open the terminal app from utilities.
_cd_ to the location containing your directory and then enter
_chmod -R 644 DIRNAME_

(where DIRNAME is the name of your directory).

HTH

Gower IT


----------

