iBook May I
July 19, 2006 8:00 PM   Subscribe

Read/write permissions on an iBook.

In my daily life I use both a iBook and a PC, and this often means that I have to shuttle files between the two. When I use a CD to do the transfering, the iBook always treats the new files as read-only, presumably because they were read-only on the CD.

If I'm transfering a lot of files and folders at once, this results in a lot of wasted time changing permissions.

Is there a way I can change the permssions of every file in my Documents folder all at once? Or a way I can tell my computer that my account has infinite power to rewrite any file it wants without having to input my password over and over? Any other solution ideas?
posted by BackwardsCity to Computers & Internet (10 answers total)
 
In Terminal:
cd ~
chmod -R o+rw Documents

posted by evariste at 8:15 PM on July 19, 2006


If you just started a new Terminal you don't need the cd ~, since you're already in ~.
posted by evariste at 8:15 PM on July 19, 2006


Response by poster: Unless I'm doing something wrong, that doesn't seem to be doing it. The files in the new subfolders are still read only.

For instance,
Documents --> PC Files --> Important --> veryimportant.doc

is still read only after I run chmod.
posted by BackwardsCity at 8:34 PM on July 19, 2006


Best answer: Try a+w instead of o+rw in that command, then?

Explanation:

chmod changes permissions. The -R flag recurses into subfolders. o+rw means "give the owner read & write permissions." a+w means "give All write permissions".
chmod -R a+w Documents

posted by evariste at 8:43 PM on July 19, 2006


the iBook always treats the new files as read-only, presumably because they were read-only on the CD.

You see, though, this isn't at all how copying files from CDs works in OSX. Normally, because CDs don't store per-file permissions, the permissions of something you copy off the CD will be full permissions minus the umask (which is a unixy security measure so that files aren't set up world-writable by default).

So, 2 questions. First, what exactly are you doing when you're changing the permissions of these copied files? Are you using the Get Info box, and a) making yourself the owner, b) making the owner read-write, c) making everyone read-write, or d) some combination of the above? Second, when you copy the files over, go into the directory with the files and type 'ls -l'. Each file should have a line like 'drwxr-xr-x 3 boaz boaz 102 Sep 7 2005 Shared'. What does the line for these read-only files look like?
posted by boaz at 10:00 PM on July 19, 2006


(CDs can store the full range of file permissions, but in most cases people don't bother. There are cases in which it makes sense to have files marked "writable" or whatever on the CD.)
posted by hattifattener at 1:08 AM on July 20, 2006


Just a note to clarify (evariste - o+rw gives permissions to "other", not "owner"). chmod settings are:

u =user
g =group
o =other
a =all
r = read
w = write
x = execute
X = execute if it's a directory or already executable (you need to be able to "execute" a directory to list its contents, IIRC).

-R makes chmod act recursively (i.e. go through all directories under the current or specified location). So

chmod -R u+rwX *

changes the permissions for all files under the current directory for the user only. Change the u to an a for "all".
posted by handee at 1:46 AM on July 20, 2006


Response by poster: The second chmod command did it.

As for what I'm doing, all I do is drag the files off the CD onto either the Desktop or the Documents folder. When I go to edit them, every one (and every folder and subfolder) is read-only by default.

So when I want to change one, I have to "Get Info" and set premission from "read only" to "read + write."

Nearly all of my experience is with using a PC, so I'm at a loss as to why OSX is deciding these are read-only files.
posted by BackwardsCity at 4:56 AM on July 20, 2006


handee- Just a note to clarify (evariste - o+rw gives permissions to "other", not "owner"). chmod settings are: Gah! Of course. How stupid of me :-)
posted by evariste at 10:57 PM on July 20, 2006


I think I fooled myself with a false mnemonic.
posted by evariste at 10:58 PM on July 20, 2006


« Older Polish/Ukrainian Film Recommendations   |   Why does artificial sweetener make my teeth numb? Newer »
This thread is closed to new comments.