![Advantech UbiQ Скачать руководство пользователя страница 90](http://html1.mh-extra.com/html/advantech/ubiq/ubiq_user-manual_2856809090.webp)
UbiQ Scenario Manager User Manual
84
5.2.33
write
Syntax
int write(int hFile,char *buf, int nCount)
Parameters
hFile: Specifies the handle referring to open file
buf: Specifies the storage location for data
nCount: Specifies the maximum number of bytes
Description
This function returns the number of bytes actually written. If the actual space
remaining on the disk is less than the size of the buffer the function is trying to
write to the disk, write fails and does not flush any of the buffer’s contents to the
disk. A return value of -1 indicates an error.
Example
int hFile;
int nLen;
char data[512];
hFile=open(“\\flash storage\\template.txt”, FILE_CREATE_RW);
setdebug(TRUE);
if (hFile==0) {
debug(“Open file failed!”);
}
else {
// process the file
seek(hFile,SEEK_END,0);
data=”This is a test file”;
nLen=write(hFile, data, strlen(datta));
close(hFile); // close the file
}
See Also
open, close, read, seek, readln, writeln, filecopy, eof
Содержание UbiQ
Страница 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...
Страница 4: ...UbiQ Scenario Manager User Manual iv...
Страница 7: ...Chapter 1 1 Introduction...
Страница 13: ...Chapter 2 2 Getting Started...
Страница 37: ...Chapter 3 3 Tutorials...
Страница 47: ...Chapter 4 4 Basic of Smart C Script Language...
Страница 62: ...UbiQ Scenario Manager User Manual 56...
Страница 63: ...Chapter 5 5 Functions Reference...