Writes a block of data to a file.
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.