fwrite_bytesT_fwrite_bytesFwriteBytesFwriteBytesfwrite_bytes (算子名称)
名称
fwrite_bytesT_fwrite_bytesFwriteBytesFwriteBytesfwrite_bytes — Write bytes to a binary file.
参数签名
描述
该算子 fwrite_bytesfwrite_bytesFwriteBytesFwriteBytesFwriteBytesfwrite_bytes writes bytes to the output
file defined by FileHandleFileHandleFileHandleFileHandlefileHandlefile_handle.
The output file must have been opened with open_fileopen_fileOpenFileOpenFileOpenFileopen_file in
binary format.
The data to be written to the file is specified as DataToWriteDataToWriteDataToWriteDataToWritedataToWritedata_to_write.
The number of bytes that are written to the file is returned in
NumberOfBytesWrittenNumberOfBytesWrittenNumberOfBytesWrittenNumberOfBytesWrittennumberOfBytesWrittennumber_of_bytes_written.
运行信息
- 多线程类型:可重入(与非独占操作符并行运行)。
- 多线程作用域:全局(可以从任何线程调用)。
- 未经并行化处理。
参数表
FileHandleFileHandleFileHandleFileHandlefileHandlefile_handle (input_control) file → HFile, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
File handle.
DataToWriteDataToWriteDataToWriteDataToWritedataToWritedata_to_write (input_control) integer-array → HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Data to be written to the file.
NumberOfBytesWrittenNumberOfBytesWrittenNumberOfBytesWrittenNumberOfBytesWrittennumberOfBytesWrittennumber_of_bytes_written (output_control) integer → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Number of bytes written to the output
binary file.
例程 (HDevelop)
* Write a binary file byte by byte.
open_file (Filename, 'append_binary', FileHandle)
fwrite_bytes(FileHandle, [0x97, 99, 102], BytesWritten)
close_file (FileHandle)
结果
If an output file is open in binary mode and no file write error occurs,
该算子 fwrite_bytesfwrite_bytesFwriteBytesFwriteBytesFwriteBytesfwrite_bytes returns 2 (
H_MSG_TRUE)
. Otherwise, an exception is
raised.
可能的前置算子
open_fileopen_fileOpenFileOpenFileOpenFileopen_file
可能的后置算子
close_fileclose_fileCloseFileCloseFileCloseFileclose_file
可替代算子
fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteStringfwrite_string
参考其它
open_fileopen_fileOpenFileOpenFileOpenFileopen_file,
close_fileclose_fileCloseFileCloseFileCloseFileclose_file,
fread_bytesfread_bytesFreadBytesFreadBytesFreadBytesfread_bytes
模块
Foundation