Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 2 - Edition Manager / Edition Manager Reference
Edition Manager Routines / Writing out Edition Data


OpenNewEdition

To initiate the writing of data from a publisher to its edition container, use the OpenNewEdition function.

FUNCTION OpenNewEdition (publisherSectionH: SectionHandle;
                         fdCreator: OSType;
                         publisherSectionDocument: FSSpecPtr; 
                         VAR refNum: EditionRefNum): OSErr;
publisherSectionH
The publisher section that is writing to the edition.
fdCreator
The Finder creator type of the new edition icon.
publisherSectionDocument
The document that contains the publisher. This parameter is used to create an alias from the edition to the publisher's document. If you pass NIL for publisherSectionDocument, an alias is not made in the edition file.
refNum
The OpenNewEdition function returns the reference number for the edition in this parameter. You specify this reference number as a parameter for subsequent calls to WriteEdition, SetEditionFormatMark, and CloseEdition to specify which publisher is writing its data to an edition. If the edition cannot be opened for writing because there is another publisher writing to it, or because the file system does not allow writing, an error is returned and OpenNewEdition sets refNum to NIL.
DESCRIPTION
The OpenNewEdition function opens an edition for writing. The function returns an flLckdErr result code if there is a subscriber on another machine reading data from the same edition. The OpenNewEdition function returns a permErr result code if there is a registered publisher to that edition on another machine.

The Edition Manager allows two registered publishers that are located on the same machine to write to the same edition. Note that multiple publishers cannot write to the same edition simultaneously--only one publisher can write to an edition at a given time.

RESULT CODES
noErr0No error
ioErr-36I/O error
flLckdErr-45Edition in use by another section
permErr-54Registered publisher on another machine
wrPermErr-61Not a publisher
editionMgrInitErr-450Manager not initialized
SEE ALSO
For an example of the use of OpenNewEdition, see Listing 2-5 beginning on
page 2-36.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996