Important: The information in this document is obsolete and should not be used for new development.
OpenNewEdition
To initiate the writing of data from a publisher to its edition container, use theOpenNewEdition
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
forpublisherSectionDocument
, 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 toWriteEdition
,SetEditionFormatMark
, andCloseEdition
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 andOpenNewEdition
setsrefNum
toNIL
.DESCRIPTION
TheOpenNewEdition
function opens an edition for writing. The function returns anflLckdErr
result code if there is a subscriber on another machine reading data from the same edition. TheOpenNewEdition
function returns apermErr
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
noErr 0 No error ioErr -36 I/O error flLckdErr -45 Edition in use by another section permErr -54 Registered publisher on another machine wrPermErr -61 Not a publisher editionMgrInitErr -450 Manager not initialized SEE ALSO
For an example of the use ofOpenNewEdition
, see Listing 2-5 beginning on
page 2-36.