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: fread/fwrite/fflush bug



Norm Green writes:

I've found what I consider to be a stream IO bug.
Not the answer you want, but -- since you're apparently looking for portability -- I'll send it anyway.

Write sharing within a file is usually a somewhat hazardous assumption. It's not particularly portable.

There are platforms that can handle this, and platforms that can't.

Here's what was received when invoking this (ported) test case on another platform:

Failed opening the reader: non-translatable vms error code: 0x1828A
%rms-e-flk, file currently locked by another user

Sharing was explicitly blocked by the platform (because of the issues that can arise), and the platform (as expected) punted this request.

The program source was tweaked to allow file-level sharing (including distributed locking and sharing, which the platform can provide), and received:

Failed when calling fread() on the reader: error 0

Having worked with the code some, it doesn't directly port -- not without more time than can be assigned to the effort right now.

There are various other portability concerns here, which can be provided off-list -- if you're interested.

If there's a language lawyer on the list, s/he can let us know what write-sharing semantics exist in this environment.

But I'd not tend to depend on sharing within a file in portable code.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to 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.