UbiQ Scenario Manager User Manual
70
5.2.18
open
Syntax
int open(char* pFilename,int open_type) or
int open(string sFilename,int open_type)
Parameters
pFilename: Specifies the Null-ended character array filename. A array that is
the path to the desired file. The path must be absolute.
sFilename: Specifies the filename string. A string that is the path to the desired
file. The path must be absolute.
Description
This function returns a file handle for the opened file. A return value of 0 indi-
cates an error.
Comments
The open function opens the file specified by filename and prepares the file for
reading or writing, as specified by open_flag:
Example
int hFile;
hFile=open(“\\flash storage\\template.txt”, FILE_CREATE_RW);
setdebug(TRUE);
if (hFile==0) {
debug(“Open file failed!”);
}
else {
close(hFile);
}
See Also
read, write, close, seek, readln, writeln, filecopy, eof
open_flag
description
FILE_READ
Opens the file for reading only
FILE_RDWR
Opens the file for reading and writing
FILE_CREATE_NEW
Create a new file. If the file exists already, it is truncated to 0
length.
FILE_CREATE_RW
Create a new file. If the file being created already exists, it is not
truncated to 0 length. Thus the file is guaranteed to open, either as
a newly created file or as an existing file. This might be useful, for
example, when opening a settings file that may or may not exist
already.
Содержание 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...