TIpClient() > File handling xHarbour Developers Network  

oTIpClient:readToFile()

Reads data from the internet connection to a local file.

Syntax

:readToFile( <cFileName>, [<nFileAttr>], <nBytes> ) --> lSuccess

Arguments

<cFileName>
This is a character string holding the name of the file to create. It must include path and file extension. If the path is omitted from <cFileName>, the file is created in the current directory.
<nFileAttr>
A numeric value specifying one or more attributes associated with the new file. #define constants from the FILEIO.CH file can be used for <nFileAttr> as listed in the table below:

Attributes for binary file creation
ConstantValueAttributeDescription
FC_NORMAL *)0NormalCreates a normal read/write file
FC_READONLY1Read-onlyCreates a read-only file
FC_HIDDEN2HiddenCreates a hidden file
FC_SYSTEM4SystemCreates a system file

<nBytes>
The number of bytes to retrieve from the server must be specified as a numeric value.

Description

Method :readToFile() transmits the specified number of bytes from the server to the local station and writes them into the file <cFileName>. Note that reading data requires a successful call to the :open() method for establishing the internet connection.

The method returns a logical value indicating success of the operation.


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe