NWWriteEA(3nw)


NWWriteEA -- writes data to Extended Attribute

Synopsis

   #include <nwnamspc.h> 
   #include <nwea.h> 
   or 
   #include <nwcalls.h> 
   

NWCCODE N_API NWWriteEA (NW_EA_HANDLE N_FAR * EAHandle, nuint32 totalWriteSize, nuint32 bufferSize, pnuint8 buffer, pnuint32 amountWritten);

Description

The parameters are as follows:

EAHandle
(IN/OUT) Points to NW_EA_HANDLE returned by either NWGetEAHandleStruct, NWFindFirstEA, NWFindNextEA, or NWOpenEA.

totalWriteSize
(IN) Specifies the size of the total Write.

bufferSize
(IN) Specifies the size of the buffer.

buffer
(IN) Points to a data buffer.

amountWritten
(OUT) Points to the amount of data written by NWWriteEA (not cumulative across multiple calls).

Return values

0x0000
SUCCESSFUL; valid data remains in the EA

0x0001
SUCCESSFUL; valid data remains in the buffer, not the EA

0x8901
ERR_INSUFFICIENT_SPACE

0x898C
NO_MODIFY_PRIVILEGES

0x899C
INVALID_PATH

0x89C8
MISSING_EA_KEY

0x89C9
EA_NOT_FOUND

0x89CB
EA_NO_KEY_NO_DATA

0x89CE
EA_BAD_DIR_NUM

0x89CF
INVALID_EA_HANDLE

0x89D0
EA_POSITION_OUT_OF_RANGE

0x89D1
EA_ACCESS_DENIED

0x89D2
DATA_PAGE_ODD_SIZE

0x89D3
EA_VOLUME_NOT_MOUNTED

0x89D4
BAD_PAGE_BOUNDARY

0x89FF
HARDWARE_FAILURE

Notices

If the EA does not exist, NWWriteEA attempts to create it.

NWWriteEA returns 0x0000 when there is more data in the EA and NWWriteEA needs to be called again. NWWriteEA returns 0x0001 when there is valid data in the buffer but none left in the EA.

NWReadEA and NWWriteEA can perform multiple actions, such as opening or creating an EA and then performing the appropriate function. To properly end NWWriteEA, NWCloseEA must be called after the last Read, Write, and/or Find EA function.

Extended Attribute values should always be read or written completely. Extended Attributes are not treated like files when transferring. Therefore, partial Reads or Writes are not allowed.


CAUTION: If an Extended Attribute is not read or written completely, data past the end of the last Read or Write may be lost!

Before calling NWWriteEA, an application must properly initialize NW_EA_HANDLE to access the EA database. An application can initialize NW_EA_HANDLE by calling NWFindFirstEA, NWFindNextEA, NWGetEAHandleStruct, or NWOpenEA. NW_EA_HANDLE is for internal use only; applications must not manipulate it in any way.

For Writes, bufferSize should be at least 512 bytes. If bufferSize is less than totalWriteSize, it must be a multiple of 512.

NWWriteEA writes up to the bufferSize number of EA information bytes or until the end of the EA data, whichever comes first. If the data to be written is larger than the buffer size, NWWriteEA must be called multiple times to write all the data to the EA.

An application should complete the entire Write before closing the EA.

Services

Extended Attribute

NCP calls

0x2222 86 02 Write Extended Attribute

 
 0x2222   86   02   Write Extended Attribute 

References

NWReadEA(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.