User`s guide
APPENDIX A Function Reference
User’s Guide 153
integer bytes (optional)
The number of bytes to read. The default is 0, which means the whole file.
integer offset (optional)
The number of bytes to skip from the beginning of the file. The default is 0.
Examples Example 1 To access local files:
uFileRead("c:\myFile.txt”)
uFileRead(“/home/testuser/myfile.txt”)
uFileRead(“file:///c:/myFile.txt”)
Example 2
To read files from a Windows share:
uFileRead(“\\fileserver\freeShare\testfile.txt”)
Example 3 To read content of a file from HTTP and HTTPS
uFileRead("http://http://www.google.com/search?hl=en&q
=pizza&btnG=Google+Search")
uFileRead("https://http://www.google.com/search?hl=en&
q=pizza&btnG=Google+Search")
Example 4
To read content of a file from FTP:
uFileRead("ftp://myUser:myPasswd@myServer/data/myFile.
txt")
uFileWrite
Description Allows you to write data to a file. If no URL is given, the data is written to a
file write.log in the Sybase IQ ETL log directory.
Syntax string uFileWrite(data [, URL] [, append] [, encoding])
Parameters
string data
The data to be written.
string URL (optional)
The URL for file access and location.
number append (optional)
Flag (0/1) indicating if the data should be appended or not.
string encoding (optional)
The encoding of the target file.