1

Every time I save a file from a web browser or copy files from our local server to my machine, the default permission "for everyone" is set to none. I'm a web developer. Files that are non-readable will not be displayed when accessed from an Apache server.

That means I always have to go through every file manually and change their permissions.

Is there a way to tell OSX that all files should be readable?

1

From the terminal you can use the chmod command to change permissions. In this case the command would be chmod a+r *. This would change all files in a folder. If you want to do this from the Finder, you would have to create a service. You could then select a group of files and change all of them at once. The instructions are given below.

  1. Open the Automator application.
  2. Select "Service" and click "Choose".
  3. Drag the action "Run AppleScript" to where it says "Drag actions or files here to build your workflow".
  4. Set "Service receives selected text in any application" to "Service receives selected files or folders in Finder".
  5. Replace the code

    on run {input, parameters}
    
        (* Your script goes here *)
    
        return input
    end run
    

    with

    on run {input, parameters}
        try
            repeat with currentfile in input
                try
                    do shell script "chmod a+r " & quoted form of POSIX path of currentfile
                end try
            end repeat
        end try
        return input
    end run
    
  6. Save service as "Readable by All".
  7. Quit the Automator application.

The service should have been saved in the ~/Library/Services folder under the name Readable by All.workflow. If not, move it there.

Now when you highlight one or more files using the Finder application, you can right click and select "Readable by All" to change the permissions.

  • why on earth is that even the default permission? I thought that's the mistake here? – ProblemsOfSumit May 18 '15 at 12:07
  • @Sumit: Ok, I am curious. If you open a Terminal application window and type the command umask -S, what do you get. I get u=rwx,g=rx,o=rx. – David Anderson May 18 '15 at 12:58
  • same for me. u=rwx,g=rx,o=rx – ProblemsOfSumit May 18 '15 at 14:26
  • Sumit: Your defaults are set correctly. the letter u stands for user (you), g stands for group (staff on my machine) and o stands for other (which is everyone). The letters r, w and x stands for read, write and execute, respectively. Your files should be saved with everyone set to read. Someone with more experience than me is going to have to answer your question. The only thing I can suggest a automatic action which would append the everyone read permission each file added to given folder. – David Anderson May 18 '15 at 14:49
  • thank you for digging into it. An automated service is not what I'd want to do here as this is such a ridiculous issue that it has to be a mistake somewhere. – ProblemsOfSumit May 18 '15 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .