Nov. 10, 2014
7:05 a.m.
On 07 Nov 2014, at 12:59 , Sven Van Caekenberghe <sven@stfx.eu> wrote:
Yes, weird code ;-)
Seems to me open:forWrite: would be better off using retryWithGC:until:, which would trigger GC regardless of whether there are registered descriptors for the currently requested handle. That would (hopefully) help against the case where too many handles have been opened (but some are waiting to be finalized), not just the case where you try opening a file in write mode that's already been opened in write mode and discarded. (which is only a restriction on Windows, IIRC) retryWithGC:until:forFileNamed: seems more intended for operations where you are not allowed *any* open handles on the file, such as renames/deletes/moves, etc. Cheers, Henry