Write to a File 0x2222 73

Writes a block of data to a file.

NetWare Servers:2.x, 3.x, 4.x, 5.x

Request Format

Offset

Content

Type

Request header

6

FunctionCode (73)

byte

7

Reserved

byte

8

FileHandle

byte[6] (Hi-Lo)

14

StartingByteOffset

long (Hi-Lo)

18

BytesToWrite

word (Hi-Lo)

20

Data

byte[BytesToWrite]

Return Values

Decimal

Hex

Description

0

0x00

Successful

131

0x83

Hard I/O Error

136

0x88

Invalid File Handle

148

0x94

No Write Privileges

149

0x95

File Detached

162

0xA2

I/O Lock Error

255

0xFF

I/O Bound Error

Remarks

If you do not have write access to the specified file or if some portion of the targeted byte block is locked for use by a different client, Write to a File will fail.

You are constrained by the current negotiated file buffer size (see Negotiate Buffer Size 0x2222 33). You cannot write more bytes of data than will fit in the buffer size. Also, you cannot write a data block that straddles a buffer size 4 KB boundary in the file.

For example, if the current buffer size were 4,096 bytes and you want to write 4,200 bytes, starting at file offset 4000, you must issue three write requests. The first request would write 96 bytes starting at offset 4000. The second request would write 4,096 bytes starting at offset 4,096. The last request would write 8 bytes starting at offset 8,192.

If you don't write any bytes at postion 0, the files will be truncated.

See Also

Negotiate Buffer Size 0x2222 33