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: Determining file permissions



Pete,

I'd just as soon avoid the standard religious wars, but I have seen a number of cases where that were really hard to justify. I actually have at least one documented case in which a file was opened read/ write, written to (yes - the write succeeded!), and closed -- all without error -- only to discover that the changes never showed up. The environment was a customer's Windows network [not sure of the particulars] and (this may be a key issue) the file was already open read/write by another user.

This scenario, in fact, led me to implement lock-files (with all of the associated hassles, such as dangling lock-files associated with abnormal terminations, etc) for all of my network-based applications, because I knew I couldn't count on reasonable error detection or reporting in all cases.

Cheers,

Rick

On Nov 10, 2005, at 12:19 PM, Peter S Lau wrote:

On Nov 10, 2005, at 1:01 PM, Richard L. Aurbach wrote:

The original writer also mentioned that the question related to cross-platform code. I've seen a number of cases in Windows where opening a file read/write generated a success-code result, but the file was actually opened read-only. There are definitely cases (particularly in cross-platform code and in some network environments) where the "try it and see" approach doesn't work.

I have little experience to fight with the file system other than the usual read, write, etc. But from what you described, would the write() fail?


Otherwise, how can you tell?  open-write-close, open-read-verify?

would that be a bug in the file system to not return the correct success code?

pete
_______________________________________________
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: 
 >Re: Determining file permissions (From: "Richard L. Aurbach" <email@hidden>)
 >Re: Determining file permissions (From: Peter S Lau <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.