NWWriteEAExt

Writes data to an Extended Attribute, using UFT-8 path and filenames

Local Servers:blocking
Remote Servers:blocking
NetWare Server:6.5 SP2 or later
Platform:NLM, Windows 2000, Windows XP
Client:4.90 SP2 or later
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Extended Attribute

Syntax

  #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);
  

Parameters

EAHandle
(IN/OUT) Points to the NW_EA_HANDLE_EXT structure returned by the NWGetEAHandleStructExt, NWFindFirstEAExt, NWFindNextEAExt, or NWOpenEAExt function.
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 NWWriteEAExt (not cumulative across multiple calls).

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL; valid data remains in the Extended Attribute

0x0001

SUCCESSFUL; valid data remains in the buffer, not the Extended Attribute

0x88F0

UTF8_CONVERSION_FAILED

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

Remarks

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.

NCP Calls

See Also

NWFindNextEAExt, NWFindFirstEAExt, NWOpenEAExt, NWReadEAExt, NWCloseEAExt