Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the Read only status of files



At 6:54 PM -0400 11/2/07, Tolu Fapohunda wrote:
Yes.  You are right.

But my real intent is to find out if I have enough permissions to rename a file. And as Kevin said, "Write permission on a directory affects whether or not you can rename files, or add other files and subdirectories to the directory." In essence, I only needed to check the read-write permission of the folder.

Aren't unix file permissions fun?

Did you know that you can change the contents of a "read only" file if you have write permissions to the enclosing directory?

Xcode used to have a bug where it would happily overwrite locked project files. Seems that if you do a "Safe Save" (as Apple recommends), there's really no need to actually have write permission to the file in question. Just write a temp file, and then swap the files (which only requires write permission to the directory). Voila!
--
-- Marshall


Marshall Clow     Idio Software   <mailto:email@hidden>

It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >How to get the Read only status of files (From: "Tolu Fapohunda" <email@hidden>)
 >Re: How to get the Read only status of files (From: "Mark Wagner" <email@hidden>)
 >Re: How to get the Read only status of files (From: "Tolu Fapohunda" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.