NWWriteEAExt
Writes data to an Extended Attribute, using UFT-8 path and filenames
#include <nwnamspc.h> #include <nwea.h> or #include <nwcalls.h> N_EXTERN_LIBRARY(NWCCODE) NWWriteEA ( NW_EA_HANDLE_EXT N_FAR *EAHandle, nuint32 totalWriteSize, nuint32 bufferSize, const nstr8 N_FAR *buffer, pnuint32 amountWritten);
These are common return values; see Return Values (Return Values for C) for more information.
If the Extended Attribute does not exist, NWWriteEAExt attempts to create it.
NWWriteEAExt returns 0x0000 when there is more data in the Extended Attribute and NWWriteEAExt needs to be called again. NWWriteEAExt returns 0x0001 when there is valid data in the buffer but none left in the Extended Attribute.
The NWReadEAExt function and NWWriteEAExt can perform multiple actions, such as opening or creating an Extended Attribute and then performing the appropriate function. To properly end NWWriteEAExt, the NWCloseEAExt function must be called after the last Read, Write, and/or Find Extended Attribute 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.
IMPORTANT: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 NWWriteEAExt, an application must properly initialize the NW_EA_HANDLE_EXT structure to access the Extended Attribute database. An application can initialize the NW_EA_HANDLE_EXT structure by calling the NWFindFirstEAExt, NWFindNextEAExt, NWGetEAHandleStructExt, or NWOpenEAExt function. The NW_EA_HANDLE_EXT structure is for internal use only; do not manipulate it in any way.
For Writes, the bufferSize parameter should be at least 512 bytes. If the bufferSize parameter is less than the totalWriteSize parameter, it must be a multiple of 512.
NWWriteEAExt writes up to the number of bytes specified by the bufferSize parameter or until the end of the Extended Attribute data, whichever comes first. If the data to be written is larger than the buffer size, NWWriteEAExt must be called multiple times to write all the data to the Extended Attribute.
An application should complete the entire Write before closing the Extended Attribute.
NWFindNextEAExt, NWFindFirstEAExt, NWOpenEAExt, NWReadEAExt, NWCloseEAExt