- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
当调用 WriteFile
时,返回的 lpNumberOfBytesWritten
是否可以在未发生错误的同步写入模式下小于 nNumberOfBytesToWrite
(返回为 真
)?写入到适当的文件(不是套接字、管道或其他特殊句柄)。 lpOverlapped
未使用。
从 docs 中并不完全清楚.
最佳答案
文档指出:
The WriteFile function returns when one of the following conditions occur:
- The number of bytes requested is written.
- A read operation releases buffer space on the read end of the pipe (if the write was blocked). For more information, see the Pipes section.
- An asynchronous handle is being used and the write is occurring asynchronously.
- An error occurs.
只有其中第一个符合您的标准,所以答案是文档很清楚 *lpNumberOfBytesWritten
总是等于 nNumberOfBytesToWrite
当函数在您调用时返回指定。
关于c++ - WriteFile lpNumberOfBytesWritten 小于 nNumberOfBytesToWrite,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5429434/
我正在学习 C,我想知道我需要在 WriteFile 和 ReadFile 方法中为这些值添加什么 lpNumberOfBytesRead 和 lpNumberOfBytesWritten Write
当调用 WriteFile 时,返回的 lpNumberOfBytesWritten 是否可以在未发生错误的同步写入模式下小于 nNumberOfBytesToWrite(返回为 真)?写入到适当的文
MSDN 说, When writing to a non-blocking, byte-mode pipe handle with insufficient buffer space, WriteF
我对 SetFilePointerEx、ReadFile 和 WriteFile API 感到有些困惑。比如说,如果我想将文件指针移动到一个新位置,这样做是否足够: if(SetFilePointer
我是一名优秀的程序员,十分优秀!